POV-Ray : Newsgroups : povray.advanced-users : user-defined functions-- basic question of use : Re: user-defined functions-- basic question of use Server Time
29 Apr 2024 08:04:31 EDT (-0400)
  Re: user-defined functions-- basic question of use  
From: Ive
Date: 25 Feb 2018 17:20:51
Message: <5a9336c3$1@news.povray.org>
Am 2/25/2018 um 20:18 schrieb Kenneth:
 > The first example (a transform function) is described only like this:
 >
 > #declare foo = function {
 >    transform {
 >      rotate <90, 0, 0>
 >      scale 4
 >      }
 >    }
 >
 > #declare myvector = foo(4, 3, 7);
 >
 > How is "myvector" supposed to be used? My assumption is that it 'acts 
like' a
 > transform-- just like any transform{..}-- but I can't get it to work.

No, "myvector" (as its name suggest) is just a vector. Its the result of 
the vector <4, 3, 7> with the transformation "foo" applied.
In this case it is simple to calculate: <16, -28, 12>

So

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


or

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

works and will position the sphere at <16, -28, 12>.


Post a reply to this message

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