Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (ozgur, Ayumi, VHX, monarch), 1,161 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Pan and tilt problems #272366
06/17/09 18:22
06/17/09 18:22
Joined: Jun 2009
Posts: 18
3
3DGSDutch Offline OP
Newbie
3DGSDutch  Offline OP
Newbie
3

Joined: Jun 2009
Posts: 18
Hi everyone. Iv'e got some problems with my 3dgs game.
When i lift up my arm, everything is OK like this image:



But when i'am rotating the arm, it goes going wrong like this:



The Angle of the PAN rotating is not correct anymore, it only works when the arm tilt is at 0.

Does someone know how i can fix this?

Code:
function gondelarm()
{
	gondelarm_1 = me;
	ent_create("Gondel.mdl",me,Gondel1);
	ent_create("Gondel.mdl",me,Gondel2);
	ent_create("Gondel.mdl",me,Gondel3);
	
	while(1){
		wait(1);
		vec_for_vertex(me.x, tussenarm_1, 122);
		
		my.tilt = tangoarm_1.roll;
						
		if (key_q){ gondelarmsnelheid += 0.005; tegen = 1; mee = 0;}
		if (key_a){ gondelarmsnelheid -= 0.005; mee = 1; tegen = 0;}
		my.pan += gondelarmsnelheid;
		if(tegen == 1 && gondelarmsnelheid >= 1.8){ gondelarmsnelheid = 1.8; }
		if(tegen == 1 && gondelarmsnelheid == 0){ gondelarmsnelheid = 0; }
		if(mee == 1 && gondelarmsnelheid <= -1.8){ gondelarmsnelheid = -1.8; }
		if(mee == 1 && gondelarmsnelheid == 0){ gondelarmsnelheid = 0; }
	}
}

action tangoarm()
{
	tangoarm_1 = me;
	ent_create("GondolArm.mdl", NULL, gondelarm);
	ent_create("TussenArm.mdl", NULL, tussenarm);

	while(1){
		
		if (key_s){ liftarmsnelheid += 0.002; tegen = 1; mee = 0;}
		if (key_w){ liftarmsnelheid -= 0.002; mee = 1; tegen = 0;}
		my.roll += liftarmsnelheid;
		if(tegen == 1 && liftarmsnelheid >= 1.8){ liftarmsnelheid = 1.8; }
		if(tegen == 1 && liftarmsnelheid == 0){ liftarmsnelheid = 0; }
		if(mee == 1 && liftarmsnelheid <= -1.8){ liftarmsnelheid = -1.8; }
		if(mee == 1 && liftarmsnelheid == 0){ liftarmsnelheid = 0; }
		
		wait(1);
	}
}


Some lines out of my codes.
Someone can help me please to fix this? Thanks !

Re: Pan and tilt problems [Re: 3DGSDutch] #272374
06/17/09 19:04
06/17/09 19:04
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Hey, not 100% sure which bits which from your code, but surely you need to just add the tilt to the arm with the chairs(gondelarm...?)

it'd be easier for you to create this all as 1 model, and use bones to achieve the effect you're trying to make,

if you can't get this sorted, and you don't mind emailing me what you have, i can look into this for you

MrGuest!

Re: Pan and tilt problems [Re: MrGuest] #272377
06/17/09 19:13
06/17/09 19:13
Joined: Jun 2009
Posts: 18
3
3DGSDutch Offline OP
Newbie
3DGSDutch  Offline OP
Newbie
3

Joined: Jun 2009
Posts: 18
I know what you mean, but the gondels (chairs) are to high poly to put them all in one model...

And with this code i take the tilt zo it will lift up correctly.
But only when i PAN the chairsarm (gondelarm) it goes to the wrong angle or something.

Code:
my.tilt = tangoarm_1.roll;


Last edited by 3DGSDutch; 06/17/09 19:15.
Re: Pan and tilt problems [Re: 3DGSDutch] #272382
06/17/09 19:38
06/17/09 19:38
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
ok, you'll probably need to use sin and cos to get it working as you need

Re: Pan and tilt problems [Re: MrGuest] #272602
06/18/09 20:40
06/18/09 20:40
Joined: Jun 2009
Posts: 18
3
3DGSDutch Offline OP
Newbie
3DGSDutch  Offline OP
Newbie
3

Joined: Jun 2009
Posts: 18
I tried that, but it's difficult. Someone can help me with that?


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