How can I get my 3rd person camera to follow my plane?

Posted By: RocketMan

How can I get my 3rd person camera to follow my plane? - 10/25/10 01:37

vec_set(camera.x, player.x);
vec_set(camera.y, player.y);
vec_set(camera.z, player.z+125);
vec_set(camera.pan,player.pan);
Thats my code for now but I need the camera to follow -700 behind the plane (y)and when I add that, everytime my plane turns the camera turns away. Its really annoying pls help.
Posted By: 3dgs_snake

Re: How can I get my 3rd person camera to follow my plane? - 10/25/10 05:09

For what you want, you can do:
Code:
var cam_height = 125;
var cam_dist = 700;
VECTOR temp;

vec_set(&temp, me.x);
temp.z += cam_height; 
temp.x -= cam_dist * cos(me.pan);
temp.y -= cam_dist * sin(me.pan);

vec_set(camera.x, &temp);
camera.pan = me.pan ;



But it is very basic for a third person camera, you can smooth the camera movement.

PS : You can replace me by player or whatever entity you want to follow.
Posted By: RocketMan

Re: How can I get my 3rd person camera to follow my plane? - 10/25/10 23:40

Man you are the best!
Thank you so much, worked like a charm.
© 2023 lite-C Forums