POV-Ray : Newsgroups : povray.general : Regular Polygons & Prisms Server Time
11 Aug 2024 09:23:26 EDT (-0400)
  Regular Polygons & Prisms (Message 1 to 10 of 26)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Andrea Ryan
Subject: Regular Polygons & Prisms
Date: 5 Oct 1999 17:59:22
Message: <37FA73D2.E62AFFB3@global2000.net>
I am trying to create a macro for making regular polygons and prisms. I
can't get one point to rotate to the vertexes.
Brendan Ryan


Post a reply to this message

From: Jerome M  BERGER
Subject: Re: Regular Polygons & Prisms
Date: 5 Oct 1999 19:06:22
Message: <37FA8463.E65258A@enst.fr>
Andrea Ryan wrote:
> 
> I am trying to create a macro for making regular polygons and prisms. I
> can't get one point to rotate to the vertexes.
> Brendan Ryan

	If I understand correctly, what you want is vrotate: it allows you to
rotate a vector (or a point) the same way that rotate allows you to
rotate an object.

		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: Remco de Korte
Subject: Re: Regular Polygons & Prisms
Date: 5 Oct 1999 20:16:29
Message: <37FA9515.F640302@xs4all.nl>
Andrea Ryan wrote:
> 
> I am trying to create a macro for making regular polygons and prisms. I
> can't get one point to rotate to the vertexes.
> Brendan Ryan

I'm not sure if I understand you right but you might have a look at a macro I
made that produces (regular) polygons (with a soft edge). It's at:
http://www.xs4all.nl/~remcodek/pov.html (look for the softform-include).

Good luck,

Remco


Post a reply to this message

From: Andrea Ryan
Subject: Re: Regular Polygons & Prisms
Date: 6 Oct 1999 19:12:10
Message: <37FBD65E.919D4BFF@global2000.net>
I need 2d vectors for polygons but vrotate changes them into 3d vectors.
Thanks for help.
Brendan Ryan

"Jerome M. BERGER" wrote:

> Andrea Ryan wrote:
> >
> > I am trying to create a macro for making regular polygons and prisms. I
> > can't get one point to rotate to the vertexes.
> > Brendan Ryan
>
>         If I understand correctly, what you want is vrotate: it allows you to
> rotate a vector (or a point) the same way that rotate allows you to
> rotate an object.
>
>                 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: Regular Polygons & Prisms
Date: 6 Oct 1999 19:15:41
Message: <37FBD731.D0E65A14@global2000.net>
My zip file program can't open the zip file. Help!
Brendan Ryan

Remco de Korte wrote:

> Andrea Ryan wrote:
> >
> > I am trying to create a macro for making regular polygons and prisms. I
> > can't get one point to rotate to the vertexes.
> > Brendan Ryan
>
> I'm not sure if I understand you right but you might have a look at a macro I
> made that produces (regular) polygons (with a soft edge). It's at:
> http://www.xs4all.nl/~remcodek/pov.html (look for the softform-include).
>
> Good luck,
>
> Remco


Post a reply to this message

From: Remco de Korte
Subject: Re: Regular Polygons & Prisms
Date: 6 Oct 1999 22:18:41
Message: <37FC0338.130FCDFF@xs4all.nl>
Andrea Ryan wrote:
> 
> I need 2d vectors for polygons but vrotate changes them into 3d vectors.
> Thanks for help.
> Brendan Ryan
> 

Try this:

temp_vec=vrtotate(<0,1,0>,<0,0,120>);
vec=<temp_vec.x,temp_vec.y>;

That's how I got it working.

Good luck,

Remco


Post a reply to this message

From: Remco de Korte
Subject: Re: Regular Polygons & Prisms
Date: 6 Oct 1999 22:21:34
Message: <37FC03E4.E2B7A5A8@xs4all.nl>
Andrea Ryan wrote:
> 
> My zip file program can't open the zip file. Help!
> Brendan Ryan
> 
> Remco de Korte wrote:
> 
> > Andrea Ryan wrote:
> > >
> > > I am trying to create a macro for making regular polygons and prisms. I
> > > can't get one point to rotate to the vertexes.
> > > Brendan Ryan
> >
> > I'm not sure if I understand you right but you might have a look at a macro I
> > made that produces (regular) polygons (with a soft edge). It's at:
> > http://www.xs4all.nl/~remcodek/pov.html (look for the softform-include).
> >
> > Good luck,
> >
> > Remco

It's zipped with WinZip. 
Uh-oh, I installed a new version, don't tell me that it makes zips you can't
open with older zippers.
Anyways I may have answered your question in another message. If you really want
to see the macro let me know and I'll mail it to you (and make sure you'll be
able to see it).

Good luck,

Remco


Post a reply to this message

From: Andrea Ryan
Subject: Re: Regular Polygons & Prisms
Date: 6 Oct 1999 23:18:09
Message: <37FC1001.D2A41646@global2000.net>
I downloaded the zip file again and I can see the files in it. -Must have been a bad
download. Thanks for your help. :-)
Brendan Ryan

Remco de Korte wrote:

> Andrea Ryan wrote:
> >
> > My zip file program can't open the zip file. Help!
> > Brendan Ryan
> >
> > Remco de Korte wrote:
> >
> > > Andrea Ryan wrote:
> > > >
> > > > I am trying to create a macro for making regular polygons and prisms. I
> > > > can't get one point to rotate to the vertexes.
> > > > Brendan Ryan
> > >
> > > I'm not sure if I understand you right but you might have a look at a macro I
> > > made that produces (regular) polygons (with a soft edge). It's at:
> > > http://www.xs4all.nl/~remcodek/pov.html (look for the softform-include).
> > >
> > > Good luck,
> > >
> > > Remco
>
> It's zipped with WinZip.
> Uh-oh, I installed a new version, don't tell me that it makes zips you can't
> open with older zippers.
> Anyways I may have answered your question in another message. If you really want
> to see the macro let me know and I'll mail it to you (and make sure you'll be
> able to see it).
>
> Good luck,
>
> Remco


Post a reply to this message

From: Andrea Ryan
Subject: Re: Regular Polygons & Prisms
Date: 6 Oct 1999 23:40:12
Message: <37FC1530.62EAFF12@global2000.net>
I used your code but it still made 3d vectors. The last point should be the same
as the first one. This is the code that creates the vectors.

#fopen data "data.inc" append
#local rotation_no = 0;
#while (rotation_no<=sides)
#local angle_of_rotation = 360/sides;
#local temp_vec=vrtotate(<0,1,0>,<0,0,angle_of_rotation*rotation_no>);
#local vec=<temp_vec.x,temp_vec.y>;
#local rotation_no = rotation_no+1;
#write (data, "",vec,"")
#end

Remco de Korte wrote:

> Andrea Ryan wrote:
> >
> > I am trying to create a macro for making regular polygons and prisms. I
> > can't get one point to rotate to the vertexes.
> > Brendan Ryan
>
> I'm not sure if I understand you right but you might have a look at a macro I
> made that produces (regular) polygons (with a soft edge). It's at:
> http://www.xs4all.nl/~remcodek/pov.html (look for the softform-include).
>
> Good luck,
>
> Remco


Post a reply to this message

From: Remco de Korte
Subject: Re: Regular Polygons & Prisms
Date: 7 Oct 1999 05:42:06
Message: <37FC6B23.BD8C7DAA@xs4all.nl>
Andrea Ryan wrote:
> 
> I used your code but it still made 3d vectors. The last point should be the same
> as the first one. This is the code that creates the vectors.
> 
> #fopen data "data.inc" append
> #local rotation_no = 0;
> #while (rotation_no<=sides)
> #local angle_of_rotation = 360/sides;
> #local temp_vec=vrtotate(<0,1,0>,<0,0,angle_of_rotation*rotation_no>);
> #local vec=<temp_vec.x,temp_vec.y>;
> #local rotation_no = rotation_no+1;
> #write (data, "",vec,"")
> #end

I'm not sure I understand where it went wrong.
The temp_vec is a 3D-vector from which you derive vec as a 2D-vector.
I tried this and I got a file with 2D-vectors (after fixing a small typo).
I agree the last point should be the same as the first and indeed in my file the
first was: <0,1> while the last was <2.44921e-016,1>. I don't know if this
really bothers you, but 2.44921e-016 is might close to 0. If you'd really like
to avoid it you could put in something like:
#if (vec.u<.0000001) 
  #declare vec=0; 
#end
Not very elegant, but efficient enough. It won't really matter for the resulting
scene.

Bye,

Remco


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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