POV-Ray : Newsgroups : povray.advanced-users : Implicit loops in function(x,y,z) : Re: Implicit loops in function(x,y,z) Server Time
3 Jul 2024 04:43:41 EDT (-0400)
  Re: Implicit loops in function(x,y,z)  
From: slehar
Date: 14 Jul 2008 14:55:01
Message: <web.487b9ff826dbfbf0f75a90cb0@news.povray.org>
So it seems you can't do logical tests on the values of the parameters in a
function either!

#declare densityfunc = function(px,py,pz) {
  #if(px > 0 | py < 0)
    atan2(py,px)
  #else
    pi - atan2(py,px)
  #end
}

Parse Error: ... undeclared identifier 'px'

That makes it kind of difficult to use functions like atan2() that can behave
differently in different quadrants. How would you get around this kind of
thing? How can I make the function use one equation in some quadrants and a
different equation in other quadrants?


Post a reply to this message

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