PDA

View Full Version : how to calculate the transformation matrix for a rotation?



jyoung77
04-25-2003, 10:15 PM
Hi,

Can someone tell me how to calculate the transformation matrix by which a given vector can be rotated to a direction incident to another given vector (e.g. from (1, 1, 1) to (2, 7, 5)? Or is there a free library tool for this? If inside the OpenGL environment, I can use glRotate(), glGet(), etc. to get it very easily. But I often need it without the OpenGL support. Could you help? Thanks very much.

Tony

gvm
04-25-2003, 11:52 PM
Hello!
Try looking inside of NVidia SDK. There is a files called nv_algebra.cpp and nv_algebra.h. There's a structures and functions for working with vectors and matrices!
By!

jwatte
04-27-2003, 07:48 AM
Try googling for "matrix and quaternion FAQ"