|
![](/i/fill.gif) |
"Rich" <SrP### [at] ricosweb com> wrote in message
news:Xns### [at] 204 213 191 226...
> Hi gang,
> I've searched through the previous posts looking for an answer but
> haven't found one yet. I need to rotate many objects on their local Y
axis
> so that they face the origin. The objects are placed randomly, so I don't
> know "where" they are until they are transformed (or just before the
> transform, I suppose). I've looked at the reorient macro but I don't
think
> that's what I'm looking for. Can anyone help me with this?
>
> Rich Allen
If you know the targetLocation before you translate the object and the
object is defined at the origin, then you can rotate it before moving it.
If you only need to rotate around the Y axis then the angle is the arctan in
degrees of z / x. So you can use atan2d():
#declare targetLocation = <3,4,5>;
#declare targetAngle = atan2d(targetLocation.z,targetLocation.x);
Hope I understood your question correctly.
Regards,
Chris.
Post a reply to this message
|
![](/i/fill.gif) |