POV-Ray : Newsgroups : povray.advanced-users : user-defined functions-- basic question of use : Re: user-defined functions-- basic question of use Server Time
28 Apr 2024 20:18:30 EDT (-0400)
  Re: user-defined functions-- basic question of use  
From: Thorsten Froehlich
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

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