# Why would this scaling matrix have no effect?

To draw a simple model using the DirectXTk, I'm doing the following. It all works perfectly, draws correct, and so on. Except changing the scaling factor makes NO difference, and I can't figure out why.

_MissileScale = 5.0f;
XMMATRIX GetWorldMatrix()
{
XMMATRIX rotation    = XMMatrixRotationRollPitchYaw(_RotationX, _RotationY, _RotationZ);
XMMATRIX scaling     = XMMatrixScaling(_MissileScale, _MissileScale, _MissileScale);

return scaling * rotation * translation;
}


Then when I draw it, I ask for that matrix. The rotation and translation work, but not the scaling.

        XMMATRIX mView = pCamera->GetViewMatrix();
XMMATRIX mProj = pCamera->GetProjMatrix();
XMMATRIX mWorld = pMissile->GetWorldMatrix();

_ptrMissileModel->UpdateEffects([pCamera](IEffect* effect)
{
XMFLOAT3 ambientLightColor(0.5f, 0.5f, 0.5f);
auto lights = dynamic_cast<IEffectLights*>(effect);
if (lights)
{
lights->SetLightingEnabled(true);
lights->SetPerPixelLighting(true);
lights->SetLightEnabled(0, true);
lights->SetLightDiffuseColor(0, Colors::White);
lights->SetLightEnabled(1, true);
lights->SetLightEnabled(2, true);
}
});


Any thoughts? Of all the linear transformations you'd think scaling would be the hardest to get wrong! I've tried the two "flailing" attempts of reversing my order of multiplication and of transposing the matrix before handing it off to the shader, neither helped (both broke the rendering as you'd expect).

• It doesn't really seem possible to tell with just the code you've posted. Have you tried non-uniform scales too? – Ryan Aug 26 '15 at 18:48
• What happens to the matrix when you set the translation and rotation to 0 and only vary the scale? If you stop on setting the scale in the debugger, is it getting set to what you expect? Does the mWorld matrix end up looking the same in the function that calls GetWorldMatrix() as it does in GetWorldMatrix()? – user1118321 Aug 27 '15 at 3:30