POV-Ray : Newsgroups : povray.general : Star Macro : Re: Star Macro Server Time
10 Aug 2024 23:26:02 EDT (-0400)
  Re: Star Macro  
From: Andrea Ryan
Date: 11 Oct 1999 13:57:17
Message: <380223FE.D9AE3942@global2000.net>
Thanks! A five pointed star was rendered! I'll refine the code because the star is
really a decagon. The number of sides a star has is twice the number of points it
has. I'll divide the vector by the distance between the vertex of the decagon and
the midpoint of a pentagon inside the decagon to turn the decagon into a pentagon
with controllable midpoints.
Brendan Ryan

P.S. I call the distance "r" and it is equal to
(tan(180-(90+(180*((2*points)-2))/(2*points)/2)))*(cos(((180*(points-2))/points)/2))

where points is the number of points (the kind that look like arms, not the
vectors) that the star has.
I'll also be posting pictures of stars in the povray.binaries.images group.



Kevin Wampler wrote:

> Andrea Ryan 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)  //odd numbered point
> > #local vec =vrotate(<0,1,0>,<0,0,(angle_of_rotation*rotation_no)>/ptmove);
> > #break
> > #case (0) //even numbered point
> > #local vec=vrotate(<0,1,0>,<0,0,angle_of_rotation*rotation_no>);
> > #break
> > #end
>
> The problem here is that you divided by ptmove within the vrotate() statement.
> Change the fourth line to this:
>
> #local vec  =  vrotate(<0,1,0>,<0,0,angle_of_rotation*rotation_no>)/ptmove;
>
> and it should work.


Post a reply to this message

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