POV-Ray : Newsgroups : povray.general : User-Defined Functions : User-Defined Functions Server Time
1 Aug 2024 04:10:44 EDT (-0400)
  User-Defined Functions  
From: kurtz le pirate
Date: 12 Mar 2006 12:09:04
Message: <kurtzlepirate-7D0D0B.18090312032006@news.povray.org>
hello :)

reading <http://www.povray.org/documentation/view/3.6.1/231/>, i see 
that user-defined function cannot return simple vector :

FUNCTION_IDENTIFIER:
    #local FUNCTION_IDENTIFIER = function { FLOAT }               |
    #declare FUNCTION_IDENTIFIER = function { FLOAT }             |
    #local FUNCTION_IDENTIFIER = function(IDENT_LIST) { FLOAT }   |
    #declare FUNCTION_IDENTIFIER = function(IDENT_LIST) { FLOAT } |
    #local FUNCTION_IDENTIFIER = function{SPECIAL_FLOAT_FUNCTION} |
    #local VECTOR_IDENTIFIER = function{SPECIAL_VECTOR_FUNCTION}  |
    #local COLOR_IDENTIFIER = function { SPECIAL_COLOR_FUNCTION } |

#declare curve = function(tt) {
  <-22*cos(tt)-128*sin(tt)-44*cos(3*tt)-78*sin(3*tt),
  11*cos(tt)-43*cos(3*tt)+34*cos(5*tt)-39*sin(5*tt),
  70*cos(3*tt)-40*sin(3*tt)+8*cos(5*tt)-9*sin(5*tt)>
  }
... of corse don't work :( but :
#macro curve(tt)
  <-22*cos(tt)-128*sin(tt)-44*cos(3*tt)-78*sin(3*tt),
  11*cos(tt)-43*cos(3*tt)+34*cos(5*tt)-39*sin(5*tt),
  70*cos(3*tt)-40*sin(3*tt)+8*cos(5*tt)-9*sin(5*tt)>
#end

... work well :)


why this limitation ?

-- 
klp


Post a reply to this message

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