Page 1 of 1

Rotation in loops

Posted: Tue Jan 31, 2012 7:52 pm
by Lief
startshape Test
shape Test{
// Line 1 ----------
dot[ y 6 h 150 sat 0.80 b 1.0000 ]
dot[ y 6 x 0.75 z -1 h 200 sat 1.60 b 1.0000 r -60 ]
dot[ y 6 x 1.5 z -2 h 250 sat 2.40 b 1.0000 r -120 ]
dot[ y 6 x 2.25 z -3 h 300 sat 3.20 b 1.0000 r -180 ]
// Line 2 ----------
loop 4[ x 0.75 z -1 h 50 sat 0.80 b 1.0000 ]{
dot[ y 4 h 150 sat 0.80 b 1.0000 ]
}
}
shape dot {
CIRCLE[ ]
CIRCLE[ y .5 s 0.5 ]
}
// Trying to get Line 2 to rotate as in Line 1 is this possible?

Re: Rotation in loops

Posted: Tue Jan 31, 2012 8:27 pm
by Pulni
Won't "loop 4[ x 0.75 z -1 h 50 sat 0.80 b 1.0000 r -60 ]" do the trick?

Re: Rotation in loops

Posted: Tue Jan 31, 2012 9:55 pm
by MtnViewJohn
No, the rotation cannot be done in the loop transform, it must be done in the loop body.

Code: Select all

  loop i=4 [x 0.75 sat 0.8 z -1 h 50]
    dot [y 6 b 1 h 150 sat 0.8 r (i * -60)] 

Re: Rotation in loops

Posted: Fri Feb 03, 2012 9:19 am
by Lief
Thanks MtnViewJohn
Never thought of doing it that way.
Lief