[ODE] rotation matrix from normalized vector?

Aras Pranckevicius nearaz at interamotion.com
Tue Mar 11 02:11:02 2003


> Actually, once I get my other object aligned to the force vector, I don't
> care how it is rotated about that vector. That object happens to have
radial
> symmetry, so I only need to align the axis of symmetry to force vector.
> My 3D math is weak. Could you give me the right formula?

You may just use (from the ODE docs):
    void dRFromAxisAndAngle (dMatrix3 R, dReal ax, dReal ay, dReal az, dReal
angle);
    Compute the rotation matrix R as a rotation of angle radians along the
axis (ax,ay,az).

If you don't care about rotation around the axis, just supply
YourFavouriteNumber as angle :)



Aras Pranckevicius aka NeARAZ
http://www.gim.ktu.lt/nesnausk/nearaz/