I want a matrix that scales first and then rotates. I tried the code below, but it didn't work.
xRotation are rotations that shouldn't be affected by the origin.
allrot should be affected.
zScale are the scaling variables. The code below works except that it rotates and then scales.
Matrix worldMatrix = ( Matrix.CreateRotationZ(MathHelper.ToRadians(zRotation)) * Matrix.CreateRotationX(MathHelper.ToRadians(xRotation)) * Matrix.CreateRotationY(MathHelper.ToRadians(yRotation)) ) * ( Matrix.CreateTranslation(origin) * Matrix.CreateRotationY(MathHelper.ToRadians(allrot)) * Matrix.CreateScale(xScale, yScale, zScale) );