I have a question about rotation I hope I am in the correct forum.
I want to draw my car model in openGL which is made in 3d max. I have problem setting the orientation. In 3ds MAX My model is placed such that the car is pointing towards -y Axis and the top axis is +Z.
However in OpenGL I must draw my Car in the way that it should be on point L (translate to L) facing to wards vector LM and the top Vector should be LC.
This is how I tried this in openGL
(LC and LM are unit vectors and LC and LM have 90 Degree Angel)
Angel1=dotproduct(top,LC);// Angel between Z axis and LC vector
RotAxis1=crossProduct(top,LC);// Rotation axis between top and LC
Angel2=dotproduct(front, LM);// Angel between -Y axis and LM vector
RotAxis2=crossProduct(front,LM);// Rotation axis between front and LM
The problem is these rotations work properly when i do it Alone however when I do that together second rotation changes the first roation aswell and I get a wrong orientation.
I want to ask is there anyway I can combine these rotations?
that means only one rotation is enough to set the right orientation or is there any other mistake I am doing or my procedure is wrong Please let me know