quaternion from entity pan tilt roll

Posted By: Matt_Aufderheide

quaternion from entity pan tilt roll - 06/16/11 06:13

I'm trying to produce a quaternion rotation from an entity's pan tilt roll parameters in a dll...this is what im trying so far... doesn't quite work as orientations are wrong. I need this for a D3DXMatrixTransformation matrix...

D3DXQuaternionRotationYawPitchRoll
(
&qrot,
D3DXToRadian(_FLOAT(ent->pan)),
D3DXToRadian(_FLOAT(ent->tilt)),
D3DXToRadian(_FLOAT(ent->roll))
);
Posted By: jcl

Re: quaternion from entity pan tilt roll - 06/16/11 08:13

You don't need quaternions here: Use ang_to_matrix for getting a D3DX transformation matrix.

For converting an angle to a quaternion, you can either use a DirectX function, or use vec_cross to get the rotation axis and the angle about that axis. At least that's the theory, I haven't done it yet.
Posted By: Matt_Aufderheide

Re: quaternion from entity pan tilt roll - 06/16/11 22:46

ok, ang_to_matrix works for what i want... thanks.
© 2024 lite-C Forums