#### Archived

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

# 3rd Person Camera Angles

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

## 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 on other sites
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 on other sites
Ok thanx mate I think I see what u mean, just gotta work out how to implement it...

1. 1
2. 2
Rutin
17
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633735
• Total Posts
3013597
×