can someone explain this 3rd person shooter camera
camtilt=clamp(camtilt,-85,85);//clamp is only allow camtilt'value between -85 and 85
cam_dist//the distance from player to camera
fcos()//cos()*factor
fsin()//sin()*factor
////////
temp2=fcos(camtilt,-cam_dist);
vec_set(camera.x,vector(player.x+fcos(player.pan,temp2),player.y+fsin(player.pan,temp2),player.z+fsin(camtilt,-cam_dist)));
////////
the problem is when i change vec_set to below this the camera's up down become weird can't reach 85 degree up and down and camera only can move up and down a little bit
///////
vec_set(camera.x,vector(player.x+fcos(player.pan,-cam_dist),player.y+fsin(player.pan,-cam_dist),player.z+fsin(camtilt,-cam_dist)));
///////