Another good advice is to use camera.c library, or learning from it.

Quote:
camera_person(ENTITY*, VECTOR* offset, var factor)
First or third person camera, looks in the same direction as the entity and moves with it with an offset. The factor (0..1) affects the influence of the entity's tilt and roll angle. First person mode is activated with the [F5] key, third person mode with the [F6] key in the camera_startup function.



Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P