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

Post Reply
hangon
Posts: 5
Joined: Mon Sep 08, 2008 10:37 am

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

Post 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.
yoshi
Posts: 174
Joined: Sun Jul 24, 2005 5:00 am
Location: silicon valley

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

Post 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;
hangon
Posts: 5
Joined: Mon Sep 08, 2008 10:37 am

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

Post by hangon »

Thanks Yoshi
that's very neat.
Post Reply