|
|
John M. Dlugosz wrote:
>
> Here is the situation: A macro will create an object, and one of the
> parameters specifies the "up" vector of the desired object. The macro will
> generate an object initially at the origin with a hard-coded "up" direction
> (say, +y) and then translate/rotate into the final location. Translate is
> easy. How about rotate? In this case, I want to compute the arguments to
> 'rotate' so that what was +y now points paralell to the Up parameter.
>
> The axis of rotation would be the cross product of the old and new up's.
> The angle can also be figured from this (I don't know the formula off hand,
> but it's not a big mystery). BUT, POV wants a rotate command giving x,y,z
> component angles. There isn't a form to rotate (the enclosing object) by a
> specific amount along a specified axis.
>
> Anyone have the answer?
>
> TIA,
> --John
If I recall correctly there are (or is) a couple of macros at twysts
macro station that address normalizing an object in reference to the
origin. This I think is what you are attempting.
The alternative is constructing the object at origin, rotating it,
and then applying the translations you need to make. This will allow you
to maintain any rotational attribute you have given the object.
http://twysted.net
--
Ken Tyler
mailto://tylereng@pacbell.net
Post a reply to this message
|
|