PDA

View Full Version : How to make a 3rd person camera



09-17-2000, 01:29 PM
I'd like to know all details about making a 3rd person camera like in Tomb Reader and other 3D platform/racing games.

I'm using euler angles (and going to use quaternions with SLERP when the camera works)

My camera can follow an object with gluLookAt but it doesn't rotate with the object.
Do I need to do something with the move/direction vector?


please help me!! http://www.opengl.org/discussion_boards/ubb/smile.gif


HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP HELP

--------------------------------------------
"Since the wedding night, Bill Gates' wife finally
knows, why he called his company 'Microsoft'"

David
09-18-2000, 01:00 AM
This advice is off the top of my head (literally, I found it written there...) so if it is wrong then shoot someone... ;-)

When you rotate the person you need to get the reverse of the viewing vector (which would be rotated by same matrix you used to rotate the person). Then get the centre point of the person and translate that value, using the reverse viewing vector, by the distance of the camera. You now have a point to rotate (slerp) to...

ALTERNATIVELY,

using gluLookAt, set the viewing point to that of the person, then simply rotate the camera by the same amount you rotated the person...

Hope this is usefull...

David

09-18-2000, 02:26 AM
Thnx, that works! http://www.opengl.org/discussion_boards/ubb/smile.gif

--------------------------------------------
"Since the wedding night, Bill Gates' wife finally
knows, why he called his company 'Microsoft'"