Rotation conversion (3DS MAX to OpenGL)
Hi!
I''m trying to write a 3DS MAX exporter plugin,
I''m using Valve''s SMD exporter for helping me understand
the MAX SDK.
Now I want to convert MAX''s coordinate system
(X=right, Z=up, Y=Away from camera) to
OpenGL''s (X=right, Y=up, Z=Towards camera).
This is easy with coordinates (switch Y and Z then negate Z)
but with rotations, it''s a different matter.
Valve''s SMD exporter does this:
(when extracting skeleton)
{
CurrNodeTM = CurrNodeTM * Inverse(ParentTM);
AffineParts affparts;
float rgflXYZRotations[3];
decomp_affine(CurrNodeTM, &affparts);
QuatToEuler(affparts.q, rgflXYZRotations);
float xRot = rgflXYZRotations[0]; // in radians
float yRot = rgflXYZRotations[1]; // in radians
float zRot = rgflXYZRotations[2]; // in radians
}
How do I convert xRot, yRot, zRot to OpenGL''s system?
I''m sort of stuck and I need pointers on what to read up on,
links, anything?
I should add that I''m new to Quaternions...
Christian
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement