POV-Ray : Newsgroups : povray.general : Star Macro Server Time
11 Aug 2024 01:19:05 EDT (-0400)
  Star Macro (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Andrea Ryan
Subject: Star Macro
Date: 10 Oct 1999 21:22:40
Message: <38013AE9.7AC40514@global2000.net>
Is it a good idea to make stars by using CSG or should they be solid
blocks?
Brendan Ryan


Post a reply to this message

From: Chris Huff
Subject: Re: Star Macro
Date: 10 Oct 1999 21:29:31
Message: <38013DF4.E8215D05@compuserve.com>
It kind of depends on what you are trying to do...
You could use a prism, CSG of a prism, a polygon, a mesh, etc. What are
you trying to accomplish?


Post a reply to this message

From: Andrea Ryan
Subject: Re: Star Macro
Date: 10 Oct 1999 21:41:05
Message: <38013F38.3D16055F@global2000.net>
I'll try to make solid star prisms if I find out how to move a point
towards the origin.
Brendan Ryan

Andrea Ryan wrote:

> Is it a good idea to make stars by using CSG or should they be solid
> blocks?
> Brendan Ryan


Post a reply to this message

From: Kevin Wampler
Subject: Re: Star Macro
Date: 10 Oct 1999 21:47:27
Message: <38014224.D54E532A@tapestry.tucson.az.us>
Andrea Ryan wrote:

> I'll try to make solid star prisms if I find out how to move a point
> towards the origin.
> Brendan Ryan

Multiply the coordinates of your point by the fraction of how much closer
you want the point to be to the origin.  For example, if you have a point
<x,y,z> and you want it to be only half as far away from the origin, it's
new coordinate will be .5*<x,y,z>


Post a reply to this message

From: Andrea Ryan
Subject: Re: Star Macro
Date: 11 Oct 1999 12:10:58
Message: <38020B13.83CA3CA1@global2000.net>
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



Kevin Wampler wrote:

> Andrea Ryan wrote:
>
> > I'll try to make solid star prisms if I find out how to move a point
> > towards the origin.
> > Brendan Ryan
>
> Multiply the coordinates of your point by the fraction of how much closer
> you want the point to be to the origin.  For example, if you have a point
> <x,y,z> and you want it to be only half as far away from the origin, it's
> new coordinate will be .5*<x,y,z>


Post a reply to this message

From: Kevin Wampler
Subject: Re: Star Macro
Date: 11 Oct 1999 13:30:06
Message: <38021F0C.13CEB0E5@tapestry.tucson.az.us>
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

From: Jerome M  BERGER
Subject: Re: Star Macro
Date: 11 Oct 1999 13:43:01
Message: <38022197.FA123A16@enst.fr>
Kevin Wampler wrote:
> 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.

	Or faster:
vrotate(<0, 1/ptmove, 0>, <0,0,angle_of_rotation*rotation_no>);

		Jerome

-- 
*******************************

* they'll tell you what can't * mailto:ber### [at] inamecom
* be done and why...          * http://www.enst.fr/~jberger
* Then do it.                 *
*******************************


Post a reply to this message

From: Andrea Ryan
Subject: Re: Star Macro
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

From: Andrea Ryan
Subject: Re: Star Macro
Date: 11 Oct 1999 15:28:29
Message: <3802395C.D6E626C4@global2000.net>
I have two pov files with the same contents and they both include the
include file that has the star macro. I can render a image with one of
the files but with the other file, I can't render a image. Both files
have the line
starbl (0,0,0,1,1,1,0,1,5,4)
"starbl" is the macro's name but it says that 'starbl' is an undeclared
identifier.
Thanks.
Brendan Ryan

Andrea Ryan wrote:

> Is it a good idea to make stars by using CSG or should they be solid
> blocks?
> Brendan Ryan


Post a reply to this message

From: Buckaroo Bill
Subject: Re: Star Macro
Date: 11 Oct 1999 16:39:36
Message: <38024b08@news.povray.org>
Is it saved in a different directory? and is your macro file in the include
file and is the include file in your include path?

Andrea Ryan <ary### [at] global2000net> wrote in message
news:3802395C.D6E626C4@global2000.net...
> I have two pov files with the same contents and they both include the
> include file that has the star macro. I can render a image with one of
> the files but with the other file, I can't render a image. Both files
> have the line
> starbl (0,0,0,1,1,1,0,1,5,4)
> "starbl" is the macro's name but it says that 'starbl' is an undeclared
> identifier.
> Thanks.
> Brendan Ryan
>
> Andrea Ryan wrote:
>
> > Is it a good idea to make stars by using CSG or should they be solid
> > blocks?
> > Brendan Ryan
>


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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