XNA - Getting mouse coordinates with a 2d Camera system with rotation/zoom/translation
问题 I have a 2d Camera with this translation matrix: Transform = Matrix.CreateTranslation(new Vector3(-Position.X, -Position.Y, 0)) * Matrix.CreateRotationZ(Rotation) * Matrix.CreateScale(new Vector3(Scale, Scale, 0)) * Matrix.CreateTranslation(new Vector3((GraphicsDevice.Viewport.Width * 0.5f), (GraphicsDevice.Viewport.Height * 0.5f), 0)); Which works for Rotation/Zoom where the origin is the center of the camera. Now I am trying to get the mouse coordinates in the world. I tried just using an