|
|
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
|
|
|
|
kurtz le pirate wrote:
>
> why this limitation ?
>
User-defined functions were designed to allow render time code in
patterns and isosurfaces. Coding a vector expression like you showed is
not required there and it would be extremely inefficient with the
current function syntax. You can however do what you want to do using
the average pigment trick - see the Vector_Function() macro in MegaPOV's
mechsim.inc
Christoph
--
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 31 Oct. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/
Post a reply to this message
|
|