POV-Ray : Newsgroups : moray.win : Rotating objects Server Time
30 Jul 2024 00:22:03 EDT (-0400)
  Rotating objects (Message 1 to 2 of 2)  
From: Steven Kroeger
Subject: Rotating objects
Date: 27 Mar 1998 11:16:53
Message: <351BD0F5.89F170C8@interquest.de>
I'm trying to get objects to rotate around the outer edge of a cylinder.
If I remember right, in povray script if you place an object at z,5 and
rotate it 90 degrees it should end up at x,5. This is what I'm trying to
do in Moray but the objects just rotate where they sit.
Is this possible in Moray?

Thanks Steve


Post a reply to this message

From: Johannes Hubert
Subject: Re: Rotating objects
Date: 27 Mar 1998 12:00:11
Message: <351BDB1B.B279DBCE@penttech.com>
Steven Kroeger wrote:

> I'm trying to get objects to rotate around the outer edge of a cylinder.
> If I remember right, in povray script if you place an object at z,5 and
> rotate it 90 degrees it should end up at x,5. This is what I'm trying to
> do in Moray but the objects just rotate where they sit.
> Is this possible in Moray?

Yes it is, but:
Moray always exports the resize, rotate, translate commands in this order:
First resize, then rotate, then translate. So your translation that puts the
object to z,5 has not yet "happened" when the rotate*90 command is exported:
First you get the rotation, then the translation, having the effect of
rotating the object in place (from what you wrote in your message, I guess
you understand what I mean).
Actually, while what you describe is very possible and o.k. in POV-Ray, it
is not the recommended way or "style" even in POV-Ray: Recommended is
usually, to create an object around the origin, resize it there, the rotate
it there, and only at the end translate it to it's position. Moray follows
this "style" closely.

This is how you can get what you need:
If you have only one object, why not simply translate it to it's new
position on the edge of the cylinder and then rotate it there "in place"
until it's orientation (in relation to the cylinder) is right again?
Or if you don't want to do that, you can create a CSG or Group with the
cylinder and the object in it. Then rotate the csg instead.
Or if you want to make several objects that look the same and sit around the
edge of your cylinder like a "string of pearls", do so: Create only one of
theses objects at first, in it's correct position somwhere on the edge of
the cylinder. Then use the "Dublicate" command in the "Edit" menu to make as
many copies of the object as you need. In the dublicate-dialog you can
specify an "Orbit" angle: If you want 36 objects sitting in a circle around
the Y-axis with 10 degrees between them, make 35 copies and use 10 as the
Y-orbit values - simple! But remember: The orbit happens around the origin,
so your cylinders axis has to fall into the axis you "orbit" around. You can
always move the whole thing (cylinder plus rotated objects) later.

Hope that helps, Johannes.


Post a reply to this message

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