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