POV-Ray : Newsgroups : povray.general : Creating a 5 point star? : Re: Creating a 5 point star? Server Time
4 Nov 2024 19:15:37 EST (-0500)
  Re: Creating a 5 point star?  
From: Warp
Date: 27 Sep 2003 07:14:05
Message: <3f7570fd@news.povray.org>
Christian Bryndum <cbr### [at] deakineduau> wrote:
>  Im a bit new in the PovRay environment, so this might be a stupid question.
> Im trying to create a 5 point star to use in a pentagram, but cant seem to
> figure out how it would be simplest and easiest way to do it.
> Anyone got any ideas or hints?

  This depends a lot on what kind of star you want to make.
  For example, do you want to make the star with cylinders connecting
opposing vertex points? Or do you want a polygon in the form of a star?
Or should perhaps this polygon have depth (ie. be a prism)?

  Getting the five vertex points of the star is easy:

#declare P1 = y;
#declare P2 = vrotate(y, z*360/5);
#declare P3 = vrotate(y, z*2*360/5);
#declare P4 = vrotate(y, z*3*360/5);
#declare P5 = vrotate(y, z*4*360/5);

  If you want to make a polygon/prism, you will need the five inner vertex
points as well... Uh, that requires some math (supposing they must be located
so that edges of the star sould have the same direction on opposing
vertices...). You can get them like this:

#declare IP1 = vrotate(R*y, z*.5*360/5);
#declare IP1 = vrotate(R*y, z*1.5*360/5);
#declare IP1 = vrotate(R*y, z*2.5*360/5);
#declare IP1 = vrotate(R*y, z*3.5*360/5);
#declare IP1 = vrotate(R*y, z*4.5*360/5);

  The only problem is calculating R.
  You could probably just try some values for it (eg. 0.5).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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