Page 1 of 1

how to create a 4X4 matrix for directX with natnet?

Posted: Mon Sep 08, 2008 12:05 pm
by hangon
Hi,
I'm trying to create a 4X4 matrix for directX from the rigidbodies streamed from arena (x y z qx qy qz qw). I have some quatToMatrix examples but not sure how to expand the matrix with the translations. Thanks for any pointers.

Re: how to create a 4X4 matrix for directX with natnet?

Posted: Mon Sep 08, 2008 12:59 pm
by yoshi
This should work with "Right Hand Coord" check box off in Other tab.

D3DXMATRIX m;
D3DXQUATERNION q(qx,qy,qz,qw);
D3DXMatrixRotationQuaternion(&m, &q);
m._41 = x;
m._42 = y;
m._43 = z;

Re: how to create a 4X4 matrix for directX with natnet?

Posted: Tue Sep 09, 2008 10:51 am
by hangon
Thanks Yoshi
that's very neat.