Page 1 of 1
How can I find the angle of Entity?
Posted: Mon Jun 04, 2012 4:36 pm
by SL RU
The question, in fact, in the topic.
I want to set the camera at an angle as the Entity.
Re: How can I find the angle of Entity?
Posted: Mon Jun 04, 2012 5:00 pm
by Norbo
The Entity.Orientation quaternion and Entity.OrientationMatrix 3x3 matrix both provide the current orientation and can be used to orient a camera. If you want Euler angles, then you'll need to convert orientation to Euler angles using the desired convention (there is no built-in helper for this since there are many different possible conventions). On the other hand, I would suggest running away from Euler angles as fast as you can; working with the transforms directly turns out to be a lot easier with any nontrivial transform.

Re: How can I find the angle of Entity?
Posted: Mon Jun 04, 2012 5:02 pm
by Norbo
Also, if you want to make a camera look at an entity as opposed to using the entity's orientation directly, the XNA Matrix.CreateLookAt method would do the trick.