3rd Person Camera Angles

Started by
1 comment, last by Kyle N 21 years, 3 months ago
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...
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.
Ok thanx mate I think I see what u mean, just gotta work out how to implement it...

This topic is closed to new replies.

Advertisement