Hello

I need to get position, scaling and rotation from a world matrix.

I would be pleased if someone could correct me if what I suppose is wrong :

(In my case matrix are row major)

So let's take this world matrix :

m11,m12,m13,m14 m21,m22,m23,m24 m31,m32,m33,m34 m41,m42,m43,m44

position=Vec3(m41,m42,m43)

scale.x=length(m11,m12,m13)

scale.y=length(m21,m22,m23)

scale.z=length(m31,m32,m33)

Then I use D3DX to get the quaternion from this matrix :

D3DXQuaternionRotationMatrix(&quaternion,&worldMatrix); D3DXQuaternionNormalize(&quaternion,&quaternion);

Does it seems you OK ?

Thanks in advance for help !

[EDIT]

My mistake, I didn't see the D3DX fonction 'D3DXMatrixDecompose()'