JITTERY CHARACTER

Posted By: noosence

JITTERY CHARACTER - 01/29/09 23:57

im using this code

camera.x = player.x - (cos(camera.pan+20) * camera_dist);
camera.y = player.y - (sin(camera.pan+20) * camera_dist);

to rotate the camera around the character, but as i rotate the character does a jittery jerking motion
is there anyway to smooth this action out?
Posted By: Ottawa

Re: JITTERY CHARACTER - 01/30/09 00:10

Hi!

Try : time_step


Ottawa smile
Posted By: unknown_master

Re: JITTERY CHARACTER - 01/30/09 04:18

function mouse_toggle() // switches the mouse on and off
{
mouse_map = arrow; // use arrow as mouse pointer
if (mouse_mode >= 2) { // was it already on?
mouse_mode = 0;
} else {
mouse_mode = 2;
}
while (mouse_mode > 0) // move it over the screen
{
vec_set(mouse_pos,mouse_cursor);
wait(1);
}
}

//i dont know if it will help your code...but im just giving you a logic to construct it...just try...






From: Philippine Game Developers.
Posted By: Jaxas

Re: JITTERY CHARACTER - 01/30/09 09:12

You think right, but to little attempt you have made to make code right wink

camera.x = player.x-camera_dist*cos(camera.pan);
camera.y = player.y-camera_dist*sin(camera.pan);

then you have left to change camera.pan to circle around player wink
Posted By: kasimir

Re: JITTERY CHARACTER - 01/30/09 11:40

i am using this code:
Code:
#define cam_tilt_min -60
#define cam_tilt_max -25

#define cam_dist_min 256		//Zoom max
#define cam_dist_max 1024		//zoom min

var camera_dist = cam_dist_max;
...
...
...
while (1)
	{
		camera.pan -= 50 * mouse_force.x * time_step * mouse_right;
		camera.tilt = clamp (ang (camera.tilt + 50 * mouse_force.y * time_step * mouse_right), cam_tilt_min, cam_tilt_max);

		camera_dist = clamp (camera_dist - 2 * mickey.z * time_step, cam_dist_min, cam_dist_max);

		camera.x = player.x - camera_dist * cos (camera.pan) * cos (camera.tilt);
		camera.y = player.y - camera_dist * sin (camera.pan) * cos (camera.tilt);
		camera.z = player.z - camera_dist * sin (camera.tilt);	

Posted By: EvilSOB

Re: JITTERY CHARACTER - 01/30/09 11:53

Make sure you have the camera moving code occuring AFTER the player
movements changes, if the camera code is in the same function.

If it is elsewhere, make sure the camera code function gets
regularly set to proc_mode = PROC_LATE; in its function.
© 2024 lite-C Forums