POV-Ray : Newsgroups : povray.general : stacking formula : Re: stacking formula Server Time
3 Feb 2023 23:48:09 EST (-0500)
  Re: stacking formula  
From: jr
Date: 1 Jan 2023 09:50:00
Message: <web.63b19c8a54dbdfbefbdc16836cde94f1@news.povray.org>
hi,

"David Kraics" <bar### [at] aolcom> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > ...
> > #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)
>
> So lets say the height of the object is .803, The object is called Floor, and I
> want to stack 66 of them. Could you reshow the code with the inputs I gave, I'm
> trying to understand this

see the documentatino for the '#for'; essentially, the value of 'Level' (think
"storey") increases, with each iteration of "the body", by one in this case.  so
the 'translate' calculates the cumulative heights at which the "Floor" begins;
simply replace 'Height' wit hyour value, and change the end value in the '#for'
to '65' (ie, from 0 to 65 == 66 values/"Floors")

<https://wiki.povray.org/content/Reference:Conditional_Directives#The_for_Directive>


regards, jr.


Post a reply to this message

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