Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector2 centre = new Vector2(Engine.VriskaEngine.GraphicsDevice.Viewport.Width / 2,
- Engine.VriskaEngine.GraphicsDevice.Viewport.Height / 2);
- //Translate to the centre
- Matrix originTranslation = Matrix.CreateTranslation(new Vector3(-centre.X, -centre.Y, 0));
- Matrix rotationMatrix = Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation));
- Matrix zoomMatrix = Matrix.CreateScale(new Vector3(zoom, zoom, 1));
- Matrix translateBackToPosition = Matrix.CreateTranslation(new Vector3(centre.X, centre.Y, 0));
- Matrix newTranslate = Matrix.CreateTranslation(new Vector3(Position, 0));
- TransformMatrix = originTranslation * rotationMatrix * zoomMatrix * translateBackToPosition
- * newTranslate;
Add Comment
Please, Sign In to add comment