   Matrix rotation and axis change (XNA)
  If I rotate a sprite 90 degrees along the Z-axis and then multiply that matrix by a translation matrix, I expect my sprite to move upwards. This is because the x-axis of the sprite is now aligned with the world's z-axis. However, the sprite instead still moves right or left along the world's z-axis. Can anyone explain what's wrong?//expect this to change the axis on which the sprite works onMatrix rr = Matrix.CreateRotationZ(MathHelper.ToRadians(90.0f));//moves to the right instead of upwards like I expectMatrix tr = Matrix.CreateTranslation(new Vector3(2, 0, 0));world = identity * rr * tr;
world = identity * rr * tr;Because the order in which you multiply you FIRST translate and then rotate. Read matrix multiplications from right to left. Also multiplying with identity is pointless by definition and just like multiplying a number with 1.   ;[quote name='Sansros' timestamp='1306035786' post='4814099']world = identity * rr * tr;Because the order in which you multiply you FIRST translate and then rotate. Read matrix multiplications from right to left. Also multiplying with identity is pointless by definition and just like multiplying a number with 1.[/quote]So what I wrote is fine if I read right to left and do:world = tr * rr;correct?   ;  The rotation needs to be applied first so the coordinate would be multiplied like so : ObjectPosition = ( tr * (rr * objectPosition) )   