Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 692 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
JITTERY CHARACTER #248911
01/29/09 23:57
01/29/09 23:57
Joined: Dec 2008
Posts: 13
N
noosence Offline OP
Newbie
noosence  Offline OP
Newbie
N

Joined: Dec 2008
Posts: 13
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?

Re: JITTERY CHARACTER [Re: noosence] #248914
01/30/09 00:10
01/30/09 00:10
Joined: Apr 2006
Posts: 737
Ottawa, Canada
O
Ottawa Offline
User
Ottawa  Offline
User
O

Joined: Apr 2006
Posts: 737
Ottawa, Canada
Hi!

Try : time_step


Ottawa smile

Re: JITTERY CHARACTER [Re: Ottawa] #248917
01/30/09 04:18
01/30/09 04:18
Joined: Jan 2009
Posts: 36
Philippines
U
unknown_master Offline
Newbie
unknown_master  Offline
Newbie
U

Joined: Jan 2009
Posts: 36
Philippines
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.

Re: JITTERY CHARACTER [Re: unknown_master] #248944
01/30/09 09:12
01/30/09 09:12
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
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


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: JITTERY CHARACTER [Re: Jaxas] #248956
01/30/09 11:40
01/30/09 11:40
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline
Senior Member
kasimir  Offline
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
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);	


Re: JITTERY CHARACTER [Re: kasimir] #248959
01/30/09 11:53
01/30/09 11:53
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
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.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1