Gamestudio Links
Zorro Links
Newest Posts
blogherenowcenter
by 3s05bmmc. 06/05/24 06:08
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (bigsmack, AndrewAMD), 1,304 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19057 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 | 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