Archived

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

FlyingDemon

3rd Person ArcBall camera

Recommended Posts

How would I go by making a 3rd person camera were the mouse controls the angles or orientation. Like an ArcBall were the camera moves along a sphere and is always focused on the object in the center. Something like the way that Americas Army's 3rd person camera works. And.. Would I be better off creating vectors to put into gluLookAt. Or creating a matrix and using glMultMatrix? So far.. I've tried using euler angles to control the movment of the camera ( heading and pitch )but I seems that the camera is always moving on a verticle cylinder, never being directly above the object. I've also tried using quaternions to rotate the camera. The rotation about the 'Y'-Axis works fine until I change the pitch of the camera. Then everything messes up, as in the quaternions work as they're supposed to (because they are ment to rotate objects like an airplane). For those of you who dont understand what im talking about, Im trying to achieve this effect (except were the movement is controlled with the mouse) [link] http://homepages.borland.com/efg2lab/Graphics/ThreeDLab.htm [/link] [edited by - FlyingDemon on January 22, 2004 12:26:48 AM]

Share this post


Link to post
Share on other sites
You might want to look into axis-angle rotations. Ben Humphrey from www.gametutorials.com has a tutorial covering this topic (tutorial #6). You can also check out this link, which Ben Humphrey includes as a reference to his tutorial: http://astronomy.swin.edu.au/~pbourke/geometry/rotate/

Hope that helps out.

-noix-

In this world gone mad, we won't spank the monkey; the monkey will spank us.

[edited by - noixtirdoe on January 24, 2004 5:59:59 PM]

Share this post


Link to post
Share on other sites