# D3DXMatrixTransformation Question

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

## 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 on other sites
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 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 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 on other sites
xyzzy00, you legend!

that function is alot easier for me to understand, Cheers for the help!

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 12
• 15
• 14
• 46
• 22
• ### Forum Statistics

• Total Topics
634054
• Total Posts
3015275
×