|
|
Thank you, this is perfect.
One of these days I'm sure I'll learn to use vdot... Maybe. I hope.
Margus
Ronald L. Parker wrote in message <372379f4.216088045@news.povray.org>...
>
>Ah, okay, that's actually how I read it at first, but I couldn't
>imagine why you would need such a thing so then I assumed that you
>really wanted the Reorient macro. I can get you an angle and an axis,
>which you can use with vaxis_rotate(), if you'd like. This isn't
>tested, so it may be faulty. In particular, you may have to fix the
>sign on the angle. (It's times like this that I don't trust a
>left-handed coordinate system.) You may, of course, get rid of all
>the intermediate local variables and make this a one-liner.
>
>#macro vvec_rotate( Vec, RefA, RefB )
> #local nA = vnormalize(RefA);
> #local nB = vnormalize(RefB);
> #local axis = vcross(nA,nB);
> #local angle = degrees(atan2(vlength(axis),vdot(nA,nB)));
> vaxis_rotate( Vec, axis, angle );
>#end
>
>
Post a reply to this message
|
|