|
![](/i/fill.gif) |
Brendan Ryan <ary### [at] global2000 net> wrote:
> I tried to divide every other vector by ptmove but it didn't work. This
code
> rotates and moves the odd numbered points and just rotates the even
numbered
> points. The code is in a while loop. Rotation_no and point_no both get
added
> to one at the end.
> Brendan Ryan
>
> #local determine = (point_no/2)-int(point_no/2);
> #switch (determine)
> #case (0.5) file://odd numbered point
> #local vec =vrotate(<0,1,0>,<0,0,(angle_of_rotation*rotation_no)>/ptmove);
> #break
> #case (0) file://even numbered point
> #local vec=vrotate(<0,1,0>,<0,0,angle_of_rotation*rotation_no>);
> #break
> #end
As Kevin pointed out, what you've divided is the rotation angle, so every
second point will be *rotated* half as much as it should be (still at the
same radius), rather than scaled. Also, the switch you've used is not
necessary, as you can actually use a counter variable that increments in
steps other than 1, eg:
#macro star_prism (Sides, StarFactor, Height1, Height2)
#local RotAngle = 360/Sides;
prism {linear_sweep linear_spline Height1, Height2, Sides+1, x,
#local Count = 0.5; #while (Count < Sides)
vrotate (x/StarFactor, y*RotAngle*Count),
#local Count = Count + 0.5;
vrotate (x, y*RotAngle*Count),
#local Count = Count + 0.5; #end
x}
#end
Post a reply to this message
|
![](/i/fill.gif) |