Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (Dico), 16,767 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
choppy camera #302042
12/16/09 07:44
12/16/09 07:44
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
I have a camera centered around 0,0,0 and it's supposed to update every frame, but it looks really choppy, can anyone help me fix it...

code:
Code:
function main()
{
	wait(2);
	video_window(vector(1,1,0),vector(1050,620,0),244,"OBJector");
	level_load ("test.wmb"); // load the level
	ShowWindow(hWnd,SW_MAXIMIZE);  // Maximize window on startup
	wait(1);diag("\n\n\n"); //delay 1 frame then add 3 line seperators to the diag file acklog.txt
	mouse_mode = 1; // show the mouse pointer
	mouse_pointer = 2;  // show mouse arrow
	//used to sync the mouse
	mouse_sync = 1;	RECT r;    GetClientRect(hWnd,&r);    video_set(r.right,r.bottom,0,0);
		
	camera.x = 0;
	camera.y = 0;
	while(1)
	{

		camera.x = -(cos(camera.pan)*300) * ((cos(camera.tilt)));
		camera.y = -(sin(camera.pan)*300) * ((cos(camera.tilt)));
		camera.z = -((sin(camera.tilt)*300))+150;
		
		camera.pan -= mouse_force.x*2;
		camera.tilt -= mouse_force.y*2;

		if(key_esc)	break;
		wait(1);
	}
	sys_exit("");
}




thanks... I hope tongue


Black holes are where God divided by zero.
Re: choppy camera [Re: Nicholas] #302044
12/16/09 07:47
12/16/09 07:47
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
camera.pan -= mouse_force.x*2*time_step;
camera.tilt -= mouse_force.y*2*time_step;

may you need to increase it hten al litle bit but time_step is realy neceseary because your fps wont turn every where the same


"empty"
Re: choppy camera [Re: flits] #302047
12/16/09 08:11
12/16/09 08:11
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
yeah, but with time_step I need a higher multiplier factor for it to move at the same speed and it still is choppy.
move my mouse physically 3" left and mouse_force.x*2 pans around a lot
move my mouse physically 3" left and mouse_force.x*2*time_step pans around only a little
raise the number to rotate faster and it's still choppy.


Black holes are where God divided by zero.
Re: choppy camera [Re: Nicholas] #302079
12/16/09 13:47
12/16/09 13:47
Joined: Aug 2002
Posts: 164
Houston
Nicholas Offline OP
Member
Nicholas  Offline OP
Member

Joined: Aug 2002
Posts: 164
Houston
I'm not quite sure why it works better, but I just stole the camera code from the included carlevel in the Gstudio7 folder.
Nice and smooth.


Black holes are where God divided by zero.

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

Gamestudio download | 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