POV-Ray : Newsgroups : povray.advanced-users : user-defined functions-- basic question of use Server Time
16 Apr 2024 02:52:10 EDT (-0400)
  user-defined functions-- basic question of use (Message 11 to 16 of 16)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Thorsten Froehlich
Subject: Re: user-defined functions-- basic question of use
Date: 26 Feb 2018 16:20:00
Message: <web.5a9479a2e9ce4cfdd21bad850@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> In fact, the 'SCALE 4' in the doc's transform was one of the nagging little
> questions I was wondering about when I originally posted: in what way the
> function affected both the new vector AND the sphere size. Of course, I didn't
> know how to use it then. ;-)
>
> The documentation can be a funny thing sometimes: The more obvious
> features have good explanations and examples, whereas the more abstruse sections
> are lacking-- when THEY need it most.

Well, the documentation was actually written as a book, not as a set of bits to
take and use without the context of the containing sections. The example you
cited is from the section "Declaring User-Defined Vector Functions". A vector
isn't a transformation, because a transormation is actually a matrix ;-)

This gets clearer if you actually read beyond the first bit of the example, down
to the second bit, which includes a spline vector function. There the
documentation explains "Function splines take the vector size into account. That
is, a function containing a spline with five components will also return a five
component vector (aka a color), a function containing a spline with two
components will only return a two component vector and so on."

Of course, having to infer that a tranform function returns a 3D vector isn't
all that trivial indeed. Probably instead of "Function splines take..." it
should read "Function transforms return a three component vector. Function
splines take..."

Thorsten


Post a reply to this message

From: Kenneth
Subject: Re: user-defined functions-- basic question of use
Date: 26 Feb 2018 17:30:00
Message: <web.5a94891be9ce4cfda47873e10@news.povray.org>
"Thorsten Froehlich" <nomail@nomail> wrote:

> Well, the documentation was actually written as a book, not as a set of bits to
> take and use without the context of the containing sections.

Interesting; I didn't know that. And I see your point; that's why I LOVE books,
rather than reading lengthy stuff on the 'net. I can instantly flip back to
something I read previously, all in context.
>
> Of course, having to infer that a tranform function returns a 3D vector isn't
> all that trivial indeed. Probably instead of "Function splines take..." it
> should read "Function transforms return a three component vector. Function
> splines take..."
>

Yes, that sounds MUCH better!


Post a reply to this message

From: Kenneth
Subject: Re: user-defined functions-- basic question of use
Date: 27 Feb 2018 19:10:00
Message: <web.5a95f296e9ce4cfda47873e10@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "Thorsten Froehlich" <nomail@nomail> wrote:
>
> > Well, the documentation was actually written as a book, not as a set of bits to
> > take and use without the context of the containing sections.
>

Thinking about this further, I suppose that there could have been a different
'philosophy' at work regarding POV-Ray's documentation itself, back when some of
the original docs were written long ago: that the program was meant for those
users who already had programming experience (and the consequent necessary math
skills to go with it.) Meaning, functions et al would have already been
understood as to their uses. Personally, I didn't come from such a programming
background (other than maths classes at university plus some old(!) FORTRAN
experience there, then some BASIC experience as just a hobby.) I guess that's
why I've always wanted the POV-Ray docs to clearly spell out what its
features do, with examples. Especially the harder-to-grasp math parts.

Although, it's a different world now; even kiddies are learning to program!
There are probably 10-year-olds who could teach me more about functions, vector
transforms etc than I already know. ;-)


Post a reply to this message

From: Jim Holsenback
Subject: Re: user-defined functions-- basic question of use
Date: 28 Feb 2018 06:02:42
Message: <5a968c52$1@news.povray.org>
On 02/26/2018 05:24 PM, Kenneth wrote:
> "Thorsten Froehlich" <nomail@nomail> wrote:
> 
>> Well, the documentation was actually written as a book, not as a set of bits to
>> take and use without the context of the containing sections.
> 
> Interesting; I didn't know that. And I see your point; that's why I LOVE books,
> rather than reading lengthy stuff on the 'net. I can instantly flip back to
> something I read previously, all in context.
>>
>> Of course, having to infer that a tranform function returns a 3D vector isn't
>> all that trivial indeed. Probably instead of "Function splines take..." it
>> should read "Function transforms return a three component vector. Function
>> splines take..."
>>
> 
> Yes, that sounds MUCH better!

agreed...http://wiki.povray.org/content/Reference:Function#Declaring_User-Defined_Vector_Functions


Post a reply to this message

From: Jim Holsenback
Subject: Re: user-defined functions-- basic question of use
Date: 28 Feb 2018 06:03:32
Message: <5a968c84$1@news.povray.org>
On 02/28/2018 06:02 AM, Jim Holsenback wrote:
> On 02/26/2018 05:24 PM, Kenneth wrote:
>> "Thorsten Froehlich" <nomail@nomail> wrote:
>>
>>> Well, the documentation was actually written as a book, not as a set 
>>> of bits to
>>> take and use without the context of the containing sections.
>>
>> Interesting; I didn't know that. And I see your point; that's why I 
>> LOVE books,
>> rather than reading lengthy stuff on the 'net. I can instantly flip 
>> back to
>> something I read previously, all in context.
>>>
>>> Of course, having to infer that a tranform function returns a 3D 
>>> vector isn't
>>> all that trivial indeed. Probably instead of "Function splines 
>>> take..." it
>>> should read "Function transforms return a three component vector. 
>>> Function
>>> splines take..."
>>>
>>
>> Yes, that sounds MUCH better!
> 
>
agreed...http://wiki.povray.org/content/Reference:Function#Declaring_User-Defined_Vector_Functions

> 
> 
oops forget a space 
http://wiki.povray.org/content/Reference:Function#Declaring_User-Defined_Vector_Functions


Post a reply to this message

From: Kenneth
Subject: Re: user-defined functions-- basic question of use
Date: 28 Feb 2018 07:35:00
Message: <web.5a96a17ae9ce4cfda47873e10@news.povray.org>
Jim Holsenback <ash### [at] nospamcom> wrote:

> >
> > agreed...
> oops forget a space
>
http://wiki.povray.org/content/Reference:Function#Declaring_User-Defined_Vector_Functions

Uh, any chance of including I've's little examples, for at least the transform
part?  :-) :-)  They would be SO helpful to poor schleps like me, ha.

sphere {myvector, 0.3
      pigment {rgb <0,1,0>}
}

or

sphere {foo(4, 3, 7), 0.3
      pigment {rgb <0,1,0>}
}


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.