Hi there!

Could you guys please help me making a 3rd person camera like that: http://www.youtube.com/watch?v=SjL_-6jWjpw ?

The player stays at the middle bottom of the screen no matter in which hight the camera is at. It's like the camera is always aiming overhead the player in the middle of the screen. The camera.tilt is affected by mouse_force.y and the player's pan by mouse_force.x.

This is what I've got so far...
Code:
function handle_camera()
{
	camera.x = player.x - 200 * cos(player.pan); 
	camera.y = player.y - 200 * sin(player.pan); 
	camera.z = player.z + 200;
	camera.pan = player.pan;
	camera.tilt = -30; 
	camera.roll = 0;
}
 
action a_player() 
{
	player = my; 
	while (1)
	{
		handle_camera();
		my.pan -= 7 * mouse_force.x * time_step;
		wait (1);
	}
}


But I don't have a clue how to handle the tilt... Thanks for your help!


Last edited by Phonech; 04/02/10 09:37.