Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / EZrotate and airplane-style flight

Author
Message
Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 22nd Dec 2004 08:13
Basically, what I'm trying to do is get it so that as you roll the plane left or right, the plane turns left and right, like in a flight simulator. Any way to do this? I've tried all sorts of combo's, none of them worked.

Cheese!
Ianhfar
19
Years of Service
User Offline
Joined: 8th Jul 2004
Location: UK
Posted: 22nd Dec 2004 17:43
Narf

you can try this , it's a very simple version of the lift vector. The Normal will always be perpendicular to the aircraft, so if you bank it will move you towards that direction, if you invert it will pull you towards the ground.

I hope it helps, if the normal is negative, try adjusting you order of the triangle CW or CCW.


REM Get Pos of Aircraft
EZro_SetPos OBJECT POSITION X(AIRCRAFT),OBJECT POSITION Y(AIRCRAFT),OBJECT POSITION Z(AIRCRAFT)

REM Declare 3 points for normal
EZro_FindPointFromOffset 10.0,0.0,0.0
fx = EZro_GetOffsetX()
fy = EZro_GetOffsetY()
fz = EZro_GetOffsetZ()
REM second point
EZro_FindPointFromOffset 0.0,0.0,10.0
fx1 = EZro_GetOffsetX()
fy1 = EZro_GetOffsetY()
fz1 = EZro_GetOffsetZ()
REM use your aircraft pos for the 3 position and find normal
REM watch your direction for the Normal's sign
EZro_FindNormal POSITION X(AIRCRAFT),OBJECT POSITION Y(AIRCRAFT),OBJECT POSITION Z(AIRCRAFT),fx1,fy1,fz1,fx,fy,fz

REM reuse the var
fx = EZro_GetNormalX()
fy = EZro_GetNormalY()
fz = EZro_GetNormalZ()

REM Add the slight change to object position

POSITION OBJECT AIRCRAFT, OSITION X(AIRCRAFT) + fx,OBJECT POSITION Y(AIRCRAFT) + fy,OBJECT POSITION Z(AIRCRAFT) + fz



Ianhfar
Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 23rd Dec 2004 05:03
Thanks, that helped. Going to have to fiddle around to see if I can get it working with angles...In the meantime, if anyone has any more suggestions...

Cheese!

Login to post a reply

Server time is: 2024-02-21 02:55:57
Your offset time is: 2024-02-21 02:55:57