I'm trying to perform some matrix transformations with the spritebatch and I don't understand what is happening with the scale matrix.
rotM = Matrix.CreateTranslation(0, 0, 0)
* Matrix.CreateFromYawPitchRoll(MathHelper.ToRadians(startRotations.Y)
, MathHelper.ToRadians(startRotations.X)
, MathHelper.ToRadians(startRotations.Z))
* Matrix.CreateScale(endScale.X, endScale.Y, 0)
* Matrix.CreateTranslation((Origin.X + PositionRec.X + Offset.X) * endScale.X
, (Origin.Y + PositionRec.Y + Offset.Y) * endScale.Y, 0);
sp.Begin(SpriteSortMode.Deferred, null, null, null, null, null, rotM);
sp.Draw(BackgroundTexture, Vector2.Zero, PositionRec, BackgroundColor * alpha);
sp.End();
Usualy I get best looking results with this order, however if I change the scale to be before the rotation everything gets weird, even using (1.1.0) scale, so I'm just getting the original size.
Lets fix the scale to 1 (excluding Z), why/how does it affect the rotations if I leave the vertices intact with the scale(I think)?
Examples:
Translation-> Rotation->Scale->Translation
http://imgur.com/ihdlepa
Translation->Scale-> Rotation->Translation
http://imgur.com/YpbOnqw
Thanks in advance, Roger