Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Kyle N

3rd Person Camera Angles

This topic is 5727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Having a bit of trouble with some 3rd Person Camera maths - I hope you guys can follow this explanation: Ive calculated the X, Y and Z pos of the camera as it rotates around the focus in the centre, so that the camera''s position can be any point on a sphere of radius r around the focus. This is calculated using the angle of rotation rotY around the Y-axis, and then the elevation angle E which is the angle that the Camera makes with the centre of the sphere. My problem is calculating the angles to rotate the camera by so that it is always facing the centre of the sphere. The rotation around Y is obviously rotY. However, as rotY increases, the orientation of E changes and so is made up of rotX and rotZ. How do I calculate rotX and rotZ so that the rotation E can be achieved by rotations around the X and Z axis? Any takers? Cheers guys, been stuck on this one for a while so any help is appreciated...

Share this post


Link to post
Share on other sites
Advertisement
Don''t think in terms of Eulear angles (x,y,z rotations) but instead think in terms of the actual camera matrix and its basis vectors.

You''ll need an ''up'', ''forwards'' and ''left'' vectors, which define the orientation of the camera. If you have a position, a target and a general indication of the up direction then this isnt too difficult.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!