0
\$\begingroup\$

OK, I have a 2d sprite in a scene and I would like to know the theory behind the camera orbiting around it with an analog stick. I know the basic code to get the input from the gamepad, but I'm having trouble getting the desired result. Basically, to simplify, the sprite is at the center of the screen. With the left analog stick I want to orbit the sprite between its a maximum distance (-1 or 1) and its minimum (0) around the centered sprite. It must be a simple thing to do, but I'm struggling with it. Thanks in advance.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You can post your edit as an answer :) \$\endgroup\$
    – Vaillancourt
    Sep 30, 2016 at 22:00
  • \$\begingroup\$ If you find a solution to your own question then the best thing to do is to post it as an answer and then select it as the accepted answer. It may feel odd to do so if your not used to stackexchange but it prevents automatic systems from bringing your question to the front page repeatedly and makes it easy for others who has the same question as you to find the answer in the future. \$\endgroup\$ Oct 1, 2016 at 7:24

1 Answer 1

-1
\$\begingroup\$

If you're using Matrix based camera, you can use Matrix.CreateRotationZ(radians) to rotate a camera. There is a good tutorial available http://www.dylanwilson.net/implementing-a-2d-camera-in-monogame

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .