POV-Ray : Newsgroups : povray.newusers : Help with writing functions... : Re: Help with writing functions... Server Time
5 Jul 2024 03:23:08 EDT (-0400)
  Re: Help with writing functions...  
From: Slime
Date: 21 Jul 2010 04:28:12
Message: <4c46af9c@news.povray.org>
> I have attempted to read the user defined function manual, but it 
doesn't really
 > go into much detail, or give examples of anything more than a one 
line function.

That's because functions don't support what you're trying to do. They 
only support simple mathematical expressions. You probably want to make 
a #macro instead. Then #declare will work.

#macro drawPlanet(siz, rads, ang, col)
     #declare xcord = rads * cos(ang * (pi / 180) );
     #declare zcord = rads * sin(ang * (pi / 180) );

     sphere
     {
        <xcord, 0, zcord>, siz
        texture { pigment { col } }
     }
#end


  - Slime


Post a reply to this message

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