|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hello. All the decades I been using povray, I usually have no problem with
adding prim after prim to create an object. This time around I am working on a
model of the Millenium Tower from the yakuza games. I have created a slice, if
you care, a single floor of the tower, adding texture for the windows and walls.
when I was younger, I would simply declare it to a label, and then stack lots of
them on top of each other.
Except now the idea of doing so seems exhausting.
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?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Bald Eagle" <cre### [at] netscapenet> wrote:
> "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
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
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> 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
#declare Height = 0.803;
> > #for (Level, 0, 65)
> > object {Floor translate y*Level*Height}
> > #end
Notice that you _could have done the loop from 1 to 66, but 0 to 65 allows you
to leave the first Floor object untranslated, since 0*Height = 0.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Awesome. Thanks everybody. Happy New Year!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|