POV-Ray : Newsgroups : povray.general : recursively defined objects and memory : Re: recursively defined objects and memory Server Time
29 Jul 2024 02:21:00 EDT (-0400)
  Re: recursively defined objects and memory  
From: Bald Eagle
Date: 13 Aug 2013 20:50:01
Message: <web.520ad382e896405b73fc9ebb0@news.povray.org>
> It would help, of course, if POV allowed redefinition of functions...


> but it seems that functions are not evaluated as I thought they were.  All it
> renders is some permutation of the first iteration. (A sphere, split in half,
> both halves scaled independently.)
>
> I was really hoping this would work. Again, if anyone has suggestions, I'd
> welcome them.


Looks like you've run into the oft-encountered function/macro parse/render
dichotomy.

As I understand it, and folks can correct me if I'm wrong or mis-state this,
functions are evaluated ONCE - at parse time.  So if you want something that
gets updated during RENDERING, then you need to call the function with a MACRO.

So do something like:

#macro Do_something (x, y)

[whiles, ifs, elses, ends, equations]

#end

Do_something (x, y)

(Think about macros like defining any CSG object, and then INVOKING it with
object {Object_name} )


Post a reply to this message

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