Jump to content
  • Advertisement
Sign in to follow this  
NovaCaine

D3DXMatrixTransformation Question

This topic is 4761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, just a question in regards to the above function. Could someone explain to me what the pScaleRotation pointer is for? I've always thought of scale and rotation as 2 separate parts of the equation.
Quote:
D3DXMATRIX *WINAPI D3DXMatrixTransformation( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter, CONST D3DXQUATERNION *pScalingRotation, <---- What does this do? CONST D3DXVECTOR3 *pScaling, CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation );
Any help would be great. Thx

Share this post


Link to post
Share on other sites
Advertisement
If you look at the help page for D3DXMatrixTransformation, you'll see this expression for what is going on:

Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt

To compute the scaling part (Msc-1 * Msr-1 * Ms * Msr * Msc), it is translating and rotating into a coordinate system where it can scale along the primary axes about the origin, performing the scale, and then rotating and translating it back.

To compute the rotation part (Mrc-1 * Mr * Mrc), it is translating into a coordinate system where it can rotate about the origin, performing the rotation, and then translating back.

The translation part is easy.

xyzzy

Share this post


Link to post
Share on other sites
Yeah i got the rest, Matrix math is a pretty new concept to me.

Cheers for the help, one last question thou, could you possibly give me an example of where one may want to change this value away from it's Identity?

Share this post


Link to post
Share on other sites
I don't know.. perhaps if you wanted to perform a non-uniform scale about some arbitrary axes. In practice, non-uniform scales generally more of a headache than they are worth, so you are probably better off sticking to them, and using D3DXMatrixAffineTransformation instead.

xyzzy

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!