grt-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [grt-talk] Re: CVS commits


From: Nikodemus Siivola
Subject: Re: [grt-talk] Re: CVS commits
Date: Mon, 14 Apr 2003 12:46:03 +0300 (EEST)

On Mon, 14 Apr 2003, Simon Adameit wrote:

> Could someone who knows more about matrix math than I (I'm not even
> supposed to know abou them yet :-)) make a (reorient Axis1 Axis2)
> transform that transforms the object so that Axis1 becomes Axis2 ?

Basically:

    (rotate-around (cross-product axis-a axis-b)
                   (acos (dot-product axis-a axis-b)))

Cross product gives you the axis of rotation: a vector that is
perpendicular to both a and b.

Provided that both axis are unit length the dot-product is equal to the
cosine of the angle between two vectors.

The tough part is the constructing the matrix for rotation around arbitaty
axis, but I have notes somewhere... I'll try to get this done by tomorrow.

Cheers,

  -- Nikodemus






reply via email to

[Prev in Thread] Current Thread [Next in Thread]