POV-Ray : Newsgroups : povray.general : Creating a 5 point star? Server Time
4 Aug 2024 00:26:15 EDT (-0400)
  Creating a 5 point star? (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Christian Bryndum
Subject: Creating a 5 point star?
Date: 27 Sep 2003 05:29:28
Message: <3f755878$1@news.povray.org>
Hiyas,

 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?

Thanks in advance.

Christian


Post a reply to this message

From: ingo
Subject: Re: Creating a 5 point star?
Date: 27 Sep 2003 05:40:30
Message: <Xns940376C37C028seed7@netplex.aussie.org>
in news:3f755878$1@news.povray.org Christian Bryndum wrote:

> 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.
> 

have a look at section "3.4.3  Prism Object" from the tutorial.


Ingo


Post a reply to this message

From: Remco de Korte
Subject: Re: Creating a 5 point star?
Date: 27 Sep 2003 06:47:45
Message: <3F756A55.E93BFC0A@onwijs.com>
Christian Bryndum wrote:
> 
> Hiyas,
> 
>  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?
> 
> Thanks in advance.
> 
> Christian

I don't know exactly what you're problem is but I made stars some time
ago using a macro I made. You can download it from my POV page at
http://www.xs4all.nl/~remcodek/pov.html (look for an animated star or
softform.inc). Nothing fancy, but it worked for me.

Cheers!

Remco


Post a reply to this message

From: Warp
Subject: Re: Creating a 5 point star?
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

From: Christian Bryndum
Subject: Re: Creating a 5 point star?
Date: 28 Sep 2003 02:31:08
Message: <3f76802c@news.povray.org>
Hi again,

Thanks guys, the different info cleared some things for me, but im still
running into some issues. Im trying to get the  it running like Ingo
mentioned, but by using Warp's vertex code. Which has been declared further
up, but i keep getting Float expected but vector or color expression found.
Kinda lost there. :(
Ive tried both of the point lines underneath here, since prisms need
coordinates to work. no luck.


prism {
linear_sweep
0,
1,
7,
<IP1>,<IP1>,<IP2>,<IP3>,<IP4>,<IP5>,<IP1>
//<P1,IP1>,<P1,IP1>,<P2,IP2>,<P3,IP3>,<P4,IP4>,<P5,IP5>,<P1,IP1>
pigment {Green}
}

Any more ideas?

Thanks in advance,
Chris.




"Warp" <war### [at] tagpovrayorg> wrote in message
news: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

From: Warp
Subject: Re: Creating a 5 point star?
Date: 28 Sep 2003 10:23:58
Message: <3f76eefe@news.povray.org>
Christian Bryndum <cbr### [at] deakineduau> wrote:
> <IP1>,<IP1>,<IP2>,<IP3>,<IP4>,<IP5>,<IP1>

  You are putting a vector inside a vector. IP1 is a vector in itself,
you can't put it inside another vector (like <IP1>) because that's just
wrong. Use it directly, ie:

IP1, IP2, IP3, ...

-- 
#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

From:
Subject: Re: Creating a 5 point star?
Date: 28 Sep 2003 20:38:17
Message: <3f777ef9@news.povray.org>
/*
NoNoNo!

prism requires 2D-vectors, so it's neccessary to construct
such vectors from the x- and y-components of P1, ... as in
the code below. I've corrected the numbering of the IP's
and added the exact value for Warp's "R". Repetition of the
first point is not neccessary here because linear-spline
prisms are automatically closed.

A second (blue) prism is calculated by simple trigonometry;
it has a variable number of 'spikes'.

This whole post is a working scene -- copy to POV-Ray,
play around with the green prism's Fat and the blue prism's
Corners and R, and enjoy!

   Sputnik

*/


// prismatic stars

// +SP8 +EP8 -FN +A0.1 +AM2 +R3


light_source { <-1, 5, -3>*100 rgb 1 }
camera { location <0, 4, -2> look_at 0.5*y }


// green prism

#declare Fat = 1; // >1: fat; <1: slim
#declare R = (3-sqrt(5))/2 * Fat;

#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);

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

prism { linear_sweep 0, 1, 11,
  <P1.x, P1.y>, <IP1.x, IP1.y>,
  <P2.x, P2.y>, <IP2.x, IP2.y>,
  <P3.x, P3.y>, <IP3.x, IP3.y>,
  <P4.x, P4.y>, <IP4.x, IP4.y>,
  <P5.x, P5.y>, <IP5.x, IP5.y>,
  <P1.x, P1.y>
  pigment { color rgb <.6, 1, .6> }
  finish { ambient .3 diffuse .7 }
  translate -1.1*x
  }


// blue prism: shorter code,

#declare Spikes = 12;
#declare R = 0.6; // or whatever ...

prism { linear_sweep 0, 1, 2*Spikes

  #declare Count = 0;
  #while (Count<Spikes)
    #declare Angle = 2*pi/Spikes*Count;

    , <-sin(Angle), cos(Angle)>
    , <-sin(Angle+pi/Spikes), cos(Angle+pi/Spikes)> * R

    #declare Count = Count+1;
    #end//while Count

  pigment { color rgb <.6, .6, 1> }
  finish { ambient .3 diffuse .7 }
  translate 1.1*x
  }


// END


Post a reply to this message

From: Christian Bryndum
Subject: Re: Creating a 5 point star?
Date: 29 Sep 2003 01:13:36
Message: <3f77bf80@news.povray.org>
Thanks again to all of you. I really appreciate it. Ive been playing around
with Warps vertex's and Frank's star code. And im getting closer.
What i was thinking of now, is to use Warps vertex's and then combine them
with some sort of box or line? im looking for something similar to the
attached file.


Thanks a mill again guys.


Christian


Post a reply to this message


Attachments:
Download '9thgatelogo.jpg' (10 KB)

Preview of image '9thgatelogo.jpg'
9thgatelogo.jpg


 

From: Warp
Subject: Re: Creating a 5 point star?
Date: 29 Sep 2003 06:05:46
Message: <3f7803fa@news.povray.org>

> prism { linear_sweep 0, 1, 11,
>   <P1.x, P1.y>, <IP1.x, IP1.y>,
>   <P2.x, P2.y>, <IP2.x, IP2.y>,
>   <P3.x, P3.y>, <IP3.x, IP3.y>,
>   <P4.x, P4.y>, <IP4.x, IP4.y>,
>   <P5.x, P5.y>, <IP5.x, IP5.y>,
>   <P1.x, P1.y>

  You only need the first 10 points. That last point is obsolete.

-- 
#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

From: Remco de Korte
Subject: Re: Creating a 5 point star?
Date: 29 Sep 2003 07:09:49
Message: <3F78127B.6CEA1907@onwijs.com>
Christian Bryndum wrote:
> 
> Thanks again to all of you. I really appreciate it. Ive been playing around
> with Warps vertex's and Frank's star code. And im getting closer.
> What i was thinking of now, is to use Warps vertex's and then combine them
> with some sort of box or line? im looking for something similar to the
> attached file.
> 
> Thanks a mill again guys.
> 
> Christian
> 
>  [Image]

Here are some suggestions:

#1, the basic idea
#2, an optical trick (relying on the orthographic camera)
#3, more towards what you wish
#4, some experimenting and it starts to look like it (without
orthographics)

You may have a closer look at some of the values, but this was fairly
easy to find.

Cheers!


(Oops, just realized I can't attach the pov code as binary here, so I'll
quote it:)

#########################################################
star1.pov:
#########################################################

camera {orthographic location <0,0,-100> look_at <0,0,0> angle 60 }
  light_source { <-100,100,-50> rgb<1,1,1> }
  light_source { <100,50,-50> rgb<.7,.7,.7>  shadowless}
  light_source { <100,200,20> rgb<.4,.4,.4> shadowless}
  light_source { <0,100,50> rgb<.1,.1,.1> shadowless}

#declare tt=0;#while (tt<5) 
  #declare p1=vrotate(<0,20,0>,<0,0,tt*72>);
  #declare p2=vrotate(<0,20,0>,<0,0,(tt+2)*72>);
  sphere{p1,1 pigment{rgb<1,.8,.2>}}
  cylinder{p1,p2,1 pigment{rgb<1,.8,.2>}}
#declare tt=tt+1;#end

#########################################################
star2.pov
#########################################################

camera {orthographic location <0,0,-100> look_at <0,0,0> angle 60 }
  light_source { <-100,100,-50> rgb<1,1,1> }
  light_source { <100,50,-50> rgb<.7,.7,.7>  shadowless}
  light_source { <100,200,20> rgb<.4,.4,.4> shadowless}
  light_source { <0,100,50> rgb<.1,.1,.1> shadowless}

#declare tt=0;#while (tt<5) 
  #declare p1=vrotate(<0,25,0>,<0,0,tt*72>);
  #declare p2=vrotate(<0,25,0>,<0,0,(tt+2)*72>);
  #declare p3=<(p1.x*2+p2.x)/3,(p1.y*2+p2.y)/3,-1>;
  sphere{p1,1 pigment{rgb<1,.8,.2>}}
  cylinder{p1,p3,1 pigment{rgb<1,.8,.2>}}
  cylinder{p3,p2,1 pigment{rgb<1,.8,.2>}}

  #declare p1=vrotate(<0,40,0>,<0,0,tt*72>);
  #declare p2=vrotate(<0,40,0>,<0,0,(tt+2)*72>);
  #declare p3=<(p1.x*2+p2.x)/3,(p1.y*2+p2.y)/3,-1>;
  sphere{p1,1 pigment{rgb<1,.8,.2>}}
  cylinder{p1,p3,1 pigment{rgb<1,.8,.2>}}
  cylinder{p3,p2,1 pigment{rgb<1,.8,.2>}}
#declare tt=tt+1;#end
  
#########################################################
star3.pov
#########################################################

camera {orthographic location <0,0,-100> look_at <0,0,0> angle 60 }
  light_source { <-100,100,-50> rgb<1,1,1> }
  light_source { <100,50,-50> rgb<.7,.7,.7>  shadowless}
  light_source { <100,200,20> rgb<.4,.4,.4> shadowless}
  light_source { <0,100,50> rgb<.1,.1,.1> shadowless}

#declare tt=0;#while (tt<5) 
  
  difference{
    union{                       
      box{<-40,-2,0><40,2,1> pigment{rgb<.6,.7,.8>}}
      cylinder{<-40,-2,0><40,-2,0>,.5 pigment{rgb<1,.8,.2>}}
      cylinder{<-40,2,0><40,2,0>,.5 pigment{rgb<1,.8,.2>}}
      translate y*10
    }
    union{
      box{<0,3,-1><50,-25,2> rotate z*18 translate <10,0,0>
pigment{rgb<1,0,0>}}
      box{<-50,3,-1><0,-25,2> rotate z*-18 translate <-10,0,0>
pigment{rgb<1,0,0>}}
    }
    rotate z*tt*72
  }
    
#declare tt=tt+1;#end

#########################################################
star4.pov
#########################################################

camera {location <0,0,-100> look_at <0,0,0> angle 60 }
  light_source { <-100,100,-50> rgb<1,1,1> }
  light_source { <100,50,-50> rgb<.7,.7,.7>  shadowless}
  light_source { <100,200,20> rgb<.4,.4,.4> shadowless}
  light_source { <0,100,50> rgb<.1,.1,.1> shadowless}

#declare tt=0;#while (tt<5) 
  
  difference{
    union{                       
      box{<-40,-2,0><40,2,1> pigment{rgb<.6,.7,.8>}}
      cylinder{<-40,-2,0><5.85,-2,0>,.5 pigment{rgb<1,.8,.2>}}
      cylinder{<10,-2,0><40,-2,0>,.5 pigment{rgb<1,.8,.2>}}
      cylinder{<-40,2,0><4.75,2,0>,.5 pigment{rgb<1,.8,.2>}}
      cylinder{<9,2,0><40,2,0>,.5 pigment{rgb<1,.8,.2>}}
      translate y*10
    }
    union{
      box{<0,3,-1><50,-25,2> rotate z*18 translate <10,0,0>
pigment{rgb<1,0,0>}}
      box{<-50,3,-1><0,-25,2> rotate z*-18 translate <-10,0,0>
pigment{rgb<1,0,0>}}
    }
    rotate z*tt*72
  }
    
#declare tt=tt+1;#end


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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