# Matrix transforming with translation/rotation/scale at center of screen

I'm trying to create a camera using matrix transforms, the gist is as follows:

Transform =
Matrix.CreateRotationZ(Rotation) *
Matrix.CreateTranslation(new Vector3(-Position.X, -Position.Y, 0)) *
Matrix.CreateScale(Zoom) *
Matrix.CreateTranslation(new Vector3(Bounds.Width * 0.5f, Bounds.Height * 0.5f, 0));


It works but with one issue. The rotation origin remains at the starting (-Position.X, -Position.Y) while the zoom works fine (at the center screen) which is obvious from the code. I'd like the rotation to occur at the center screen as well.

• Hey Avagantamo, could you provide more code? Because currently, it's not sure what values the Rotation, Position, Zoom and Bounds are. Nov 17 '20 at 7:26
• Hi @Steven . The code is from this link community.monogame.net/t/simple-2d-camera/9135 with an extra property (Rotation) similar to how the Zoom works in it. The above code is an altered version from the UpdateMatrix() method for including the rotation Nov 17 '20 at 8:13