Skip to main content
gamedev.net
🔒 Locked

Basic aircraft physics

Started by warhound Jun 14, 2010 at 6:48 PM 6 replies 3.4k views
Original Post
warhound
warhound
In the game that I'm currently creating involves some basic aircraft physics. What I'm looking to do is apply gravity to an aircraft. I'm a little confused on how to apply gravity to the aircraft when it's climbing and when it's at a zero angle. I can see that gravity will accelerate the aircraft when it dives, but the other parts confuse me. Also, turns are also a bit of a problem......any help would be appreciated.
No one expects the Spanish Inquisition!
poss74
poss74
How complicated do you want to get?

At its (very) simplest, I'd have four vectors: a constant one for gravity pointing straight down, one perpendicular to the wings for lift, one parallel to the direction of flight for thrust, and an inverse one for drag. Adding these four vectors together should give you an overall direction vector that the airplane moves.

If at first you don't succeed, call it version 1.0You don't stop playing because you get old; you get old when you stop playing.
warhound
warhound
I'll give you an idea of how complex the game is. It's nothing more than some basic flying around, not really a simulator. Have you ever played Mars Explorer? It's no more complex than that. If you have any more advice, it would be greatly appreciated, but what you have written does help. If you could just explain that a bit more, that would be helpful. Thanks!

EDIT: If you could explain the lift and drag concepts a bit more, that would be greatly appreciated!

[Edited by - kryotech on June 14, 2010 7:09:54 PM]
No one expects the Spanish Inquisition!
warhound
warhound
Alright, so I took the advice mentioned earlier, but I can't figure out how to calculate the components for the vectors. All I have is a magnitude for thrust, drag, lift, and gravity. How do I calculate the components for the vectors?
No one expects the Spanish Inquisition!
Zakwayda
Zakwayda
Quote:
All I have is a magnitude for thrust, drag, lift, and gravity. How do I calculate the components for the vectors?
Are you asking how to compute the directions for these four vectors:
Quote:
Original post by poss74
a constant one for gravity pointing straight down, one perpendicular to the wings for lift, one parallel to the direction of flight for thrust, and an inverse one for drag
?

[Edited by - jyk on June 15, 2010 3:59:49 PM]
warhound
warhound
I'm asking how I compute the x,y, and z components of these vectors.
No one expects the Spanish Inquisition!
stonemetal
stonemetal
Quote:
Original post by kryotech
EDIT: If you could explain the lift and drag concepts a bit more, that would be greatly appreciated!


When a shape passes through air it pushes the air out of the way to move through that space. This is drag.

For air plane wings the two most important factors in lift are shape and angle of attack. Now as the wing passes through the air it pushes the air under the wing down like a fan blade this creates pressure that pushes the wing up. The on the back side of the wing there is less air than there used to be (because the wing just pushed it out of the way) this causes a vacuum which pulls up on the wing. These two forces combined are known as lift.

Drag and lift are directly determined by the air speed of the aircraft(air speed is speed relative to the air around the plane) If I were you I would make stuff up, though reading a mechanical engineering book on aircraft design could be most enlightening.
Quote:
I'm asking how I compute the x,y, and z components of these vectors.

lift is always vertical to the plane, gravity is always down irrespective of plane orientation, thrust is always out the back of the plane(unless you make harriers ) drag is like friction it is always opposite the direction the plane is moving.
Zakwayda
Zakwayda
Quote:
I'm asking how I compute the x,y, and z components of these vectors.
The gravity vector should be easy; it'll most likely be a + or - cardinal axis (e.g. y or z).

The rest of the vectors are dependent on the orientation of the plane. Whatever representation you're using for the orientation (e.g. matrix, quaternion, etc.), the first step is to get the orientation into matrix form. The rows or columns of the matrix (depending on convention) will be the local direction vectors for the plane. Presumably, you'll want to use the local 'up' vector for the force perpendicular to the wings, the local 'forward' vector for thrust, and the negative of the forward vector for drag.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.