Page 1 of 1

Quaternion to Vector3D

Posted: Tue Feb 27, 2007 8:09 pm
by ShadowDust
I've tried and tried and failed at creating a function that takes an Irrlicht Vector3D(used for rotation) and returns a ODE Quaternion and back again.

can some1 with a bit more knowledge at maths then I do this for me, yes I have searched google, and the examples i did find i tried and didn't succeed.

Thanks.

Posted: Tue Feb 27, 2007 9:25 pm
by bitplane
did you search quaternion.h? ;)
It has a constructor which takes euler angles:

Code: Select all

quaternion q(x,y,z);
edit:

back again would be this:

Code: Select all

vector3df v;
q.toEuler(v);

Posted: Thu Mar 08, 2007 3:34 am
by ShadowDust
yes, this would be nice, but I'm using Irrlicht.Net, Sorry if i forgot to tell you... perhaps i posted in the wrong forum?