Help for Airplane

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Brainsaw
Posts: 1177
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Help for Airplane

Post by Brainsaw »

Hello,

I am currently trying to integrate an airplane into one of the demos of my IrrODE project. I have come to a point where my poor mathematical knowledge is not enough: the plane is moving into a direction and facing a direction. These do not have to be the same, but I need to apply a force that brings these 2 directions together, so I need to calculate the angles between the two vectors for heading and velocity. Can anyone give me a hint on how to do this? Thanks a lot.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

You can find something here: Turn to target in 3D
Just look at the functions at the beginning.

Also this might be of some help: Free Flight (space flight) functions

Problem with airplane movement and flight is that you have to apply whole set of physical values in to calculation like gravitation, drag, angle of attack and so on ...generally result is that airplane is not moving in to exact direction it is facing. Its all about vectors so you should know and understand trigonometry and matrices and/or quaternions well.
ben
Posts: 18
Joined: Fri May 22, 2009 4:43 pm

Post by ben »

inversecos(dot product of 2 unit vectors)

will give you the angle between the 2 vectors
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Problem is, for angle to be of some use, it have to be related to some defined coordinate system (or in other words, laying in plane defined by those coordinates) ...either local or global ...which means, you need to find more than just one angle ...mostly you need 2 or even 3 angles, so you can rotate your object with eulers.
porcus
Posts: 149
Joined: Sun May 27, 2007 6:24 pm
Location: Germany

Post by porcus »

During flight you have 4 forces which are affecting the airplane. (Lift, weight, thrust and drag)
The lift vector is the normal vector of the wings.
The weight vector is always pointing to the ground (it's NOT always
the opposite of lift(only in straight and level flight)).
The thrust vector is always pointing to the front.
The drag vector is pointing into the opposite direction than the movement
and it's length depends on the velocity (relative to the frontal wind component ) and the surface of the airplane.
The length of the lift vector is proportional to the length of the thrust vector (depends on the wing).

I hope it helps.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

porcus >> generally true with few small exceptions:

-weight is not force ...gravity is.

-lift vector can be generated by any surface not just wings and then wings itself can be V shaped instead of level. In any case lift vector of airplane is sum of all of them.

-drag is affected also by drag coefficient which depend on smoothenes of surface and shape of airplane (simply speaking). Some shapes are aerodynamically more efficient than others and some surfaces generate less drag than others (shark skin).

Then resulting movement vector is sum of lift, weight, thrust and drag.
Post Reply