POV-Ray : Newsgroups : povray.general : Twist an isosurface : Re: Twist an isosurface Server Time
31 Jul 2024 16:30:43 EDT (-0400)
  Re: Twist an isosurface  
From: dave vanhorn
Date: 20 Dec 2006 09:29:09
Message: <458948b5$1@news.povray.org>
> Replace this line with:
> #declare Twist_x = function(x, y, z)
>
> You can't pass a function identifier as a parameter to another
> function, but you don't need to to be able to call it (huh, does
> that sentence make sense?).

I guess not :)  I'm still lost.  Here's the current implementation


  #ifndef (SolidHeart)
    #ifndef (TwistHeart)
      #declare Heart_Function = function { f_torus 
(y-pow(abs(x),Sharpness)*Bend, z*1, x, 0.8,0.1) }
    #else
      #declare K = 1;
      #declare f = function {K*y}
      #declare Twist_x = function (x,y,z)
                         {x * cos (f (y)) + z * sin (f (y))} <-- "Invalid 
number of parameters, 1 supplied, 3 required.

      #declare Twist_z = function (x,y,z)
                         {(-x * sin (f (y)) + z * cos (f (y))}

      #declare Heart_Function = function { f_torus 
(y-pow(abs(Twist_x),Sharpness)*Bend,
                                                   (Twist_z*2),
                                                   (Twist_x,
                                                   0.8,0.1) }
    #end
  #else
    #declare Heart_Function = function { f_sphere 
(y-pow(abs(x),Sharpness)*Bend, z*2, x, 0.6    ) }
  #end


Post a reply to this message

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