POV-Ray : Newsgroups : povray.general : please assist with function : Re: please assist with function Server Time
31 Jul 2024 06:16:23 EDT (-0400)
  Re: please assist with function  
From: alphaQuad
Date: 1 Oct 2007 16:15:01
Message: <web.470154bbfdc645c010a721da0@news.povray.org>
Nicolas Alvarez <nic### [at] gmailisthebestcom> wrote:

> As far as I know, a function cannot return a vector. Maybe you're
> actually needing a #macro, not a function.


Right now you may only declare vector functions using one of the special
function types. Supported types are transform and spline functions. For
example:

#declare foo = function {
   transform {
     rotate <90, 0, 0>
     scale 4
   }
 }

 #declare myvector = foo(4, 3, 7);

 #declare foo2 = function {
   spline {
     linear_spline
     0.0, <0,0,0>
     0.5, <1,0,0>
     1.0, <0,0,0>
   }
 }
so without transform or spline it would be use of global floats only?
#declare axis_rotation = function(r, a,b,c,d,e,f) {?
} and one would still need to parse a vector at some point.



3.2.1.6  User-Defined Functions
Some objects allow you to specify functions that will be evaluated while
rendering to determine the surface of these objects. In this respect
functions are quite different to macros, [(macros?) assumed] which are
evaluated at parse time but do not otherwise affect rendering. Additionally
you may call these functions anywhere a Float Function is allowed, even
during parsing. The syntax is identical to Float Expressions, however, only
float functions that apply to float values may be used. Excluded are for
example strlen or vlength. You find a full list of supported float
functions in the syntax definition below.


not very clear at best.


Post a reply to this message

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