POV-Ray : Newsgroups : povray.general : stacking formula : Re: stacking formula Server Time
25 Apr 2024 14:02:27 EDT (-0400)
  Re: stacking formula  
From: Bald Eagle
Date: 1 Jan 2023 09:15:00
Message: <web.63b1951854dbdfbe1f9dae3025979125@news.povray.org>
"David Kraics" <bar### [at] aolcom> wrote:

> Is there some kind of loop I can use to do this for me, and maybe return a value
> so I can add new things on top of the stack?

Of course.

Your level has a ymin and a ymax.  ymax-ymin equals your height.
do a loop, instantiate your object, and then translate each subsequent object in
the y direction by the incremented height.

#declare Ymin = min_extent (Object).y;
#declare Ymax = max_extent (Object).y;
#declare Height = Ymax-Ymin;

#for (Level, 0, 5)
     object {Object translate y*Level*Height}
#end


(untested code)


- Bill


Post a reply to this message

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