• entries
62
78
• views
48501

# a better camera

223 views

what is the best method of implementing a 3rd person camera (smoothly) in a fast action game, at the moment im just using an average of the last X frames orientation/position. which is ok i suppose but a camera that lags more is also nice cause u get to see the ship from various angles etc. the problem though is , it can lag to much in a firefight (which can happen at anytime), heres a version weighted to older frames ( which i just now wrote UI )

for ( int i=0; i		{			float dif = 0;			if ( i < use_camera_pos_slot )				dif = use_camera_pos_slot - i;			else				dif = num_smooth_frames - (i - use_camera_pos_slot);			dif = 1.0 / dif;			average_cam_dirMATRIX += prev_cam_dirMATRIX * dif;			average_camPOS += prev_camPOS * dif;		}average_cam_dirMATRIX.Orthonormalize();use_camPOS = average_camPOS / (num_smooth_frames);

what do other fast paced 3rd person games use?
or articles/pieces on giving the player the best camera view/cinematic experience possible

## 1 Comment

i coded the above after i came back from the pub last saturday after the rugby game. funny thing is i thought it was working, oh well heres the correct versiomn

for ( int i=0; i<num_smooth_frames; i++ )
{
float dif = 0;
if ( i < use_camera_pos_slot )
dif = use_camera_pos_slot - i;
else
dif = num_smooth_frames - (i - use_camera_pos_slot);

average_cam_dirMATRIX += prev_cam_dirMATRIX[i] * dif;
average_camPOS += prev_camPOS[i] * dif;
}

use_camPOS = average_camPOS * ( 2.0 / float(num_smooth_frames) ) * (1.0/float(num_smooth_frames) );

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account