Hybrid View

Third Person Camera

Hello all,

At the moment I have a cube in my 3D space in which I can do pitch, yaw and roll and move in the direction the cube is facing (like a plane). My camera currently just sits in one position and follows the cube with gluLookAt. What I'm trying to achieve with the camera however is to make it always behind the cube while it moves/pitches/yaws/rolls etc. like a third person camera.

So far, I've attempted to turn the camera while the cube turns, but my calculations seem to be wrong since the camera doesn't turn in sync with the cube.