POV-Ray : Newsgroups : povray.advanced-users : user-defined functions-- basic question of use : Re: user-defined functions-- basic question of use Server Time
26 Apr 2024 16:46:15 EDT (-0400)
  Re: user-defined functions-- basic question of use  
From: Kenneth
Date: 26 Feb 2018 14:35:01
Message: <web.5a945ffce9ce4cfda47873e10@news.povray.org>
In testing this, I see something worth noting.

First, I'll create what looks like a good analog of the doc's function example
(the way that example's operation might appear to a typical or new-user), but
without any function:

sphere{0,0.3 translate <4,3,7>
       transform{
            rotate <90,0,0>
            scale 4
                }
}

And here's Ive's 2nd function-use example (although his 1st works
identically)...
 sphere {foo(4, 3, 7), 0.3}

Both of these put the sphere at exactly the same transformed vector location--
but the non-function example scales the size of the sphere by 4, whereas the
function does not.

Of course, I see the obvious reason why the scales are different in these two
constructs-- but the doc's function example would not be clear at all as to the
difference (IMO) without a useful example to demonstrate it. It would depend on
how familiar users are with functions themselves, and what they do. (Would a new
user attempt to create a function at all, lacking any POV-Ray experience? Maybe,
maybe not.)

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.


Post a reply to this message

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