A place to discuss everything related to Newton Dynamics.
Moderators: Sascha Willems, walaber
by andygib » Fri Jan 13, 2012 7:53 am
Hi, just want to clear some confusion up, im playing with "simple" flight physics trying to get some half decent flight dynamics implimented and got a little confused about drag.
When ever i read about flight dynamics the drag vector is always opposite the relevent wind, or plane velocity.
Is that the "only" drag i need? Or do i need a general "air drag" in there too?
As if i apply drag to only the 1 axis then the plane just doesnt fly as expected? But i apply a very simple drag like *pusedo code* planedrag = vec3 (planevel.x*50,planevel.y*50,planevel.z*50) and minus this of the force vector then it flies as expected but i know this isnt correct. This si all local coords.
Thanks
Andy
-
andygib
-
- Posts: 40
- Joined: Fri Jan 13, 2012 7:47 am
by Julio Jerez » Fri Jan 13, 2012 9:08 am
the lift and drag are both drag forces.
the lidt in a function of teh air speed (plain speed) and scale but some gemetic factor of teh plane wings and the angle beterrn the velcity of teh plane and the orientaion of the wing
it is the direction you are having wrong.
the lift force is perpendicular to the wing velocity.
say the velocity vector is (0, 0, 1) move along z
the plain and wing forn vector is (0, 0.1, 0.9)
the angle between of attach (the angle between teh plane frame an dthe velocity is
angle = acos (dot product (unitvelocVector, plainefornVector)
form the angle of attack you from in the lift table and get teh coreficent of lift
with tha coefficent you calaculate the teh magnutud of the lift force on tha wing
L = coefficentofLift * Veloci* velocity
the diretion of that L is the vector perpendiculat to the velocity and the wing
to get that vetor you you ge teh up vetoor of the plane and cross it with the velocity, vector
then the result you cross again with the velocity (make sure you get teh order right)
liftdir = normalize (cross (cross (veloc , plainUp) , veloc))
liftforce = liftdir.scale (L)
that force is applyed at the center pf p[resire opf the wing, you cn aus eteh center of teh wing.
nwo you caculat the diffrence form teh cent of th wn to teh centr of teh palin;
centor r = wingCenter - plinOrigin
the torque that teh lift force apply to teh plain is
Torque = cross (r, liftforce );
you do the same fo wing drag, and you accumulate the face andteh torque.
the result is the force that tah wing will apply to the plain.
you add than force and toque to the body.
and you do teh same in a loop for all other wings (left, right, rear alerons, and roter)
the resutl si a fgliyn airaplin that you cna controll but modifieng the wing control surfaces.
it should be very eassy to get it going.
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by andygib » Tue Jan 17, 2012 9:11 am
HI Julio, Thanks for the reply, great information.
Im trying to impliment the structure you wrote but puzzled to when / if you are in global or local space.
Do you calculate forces local or global?
Do you apply forces and torques local or global?
Also, to find the "Lift Vector" why can i not do
- Code: Select all
liftv = Cross(body.side,body.velocity*-1)
?
Thanks
Andy
-
andygib
-
- Posts: 40
- Joined: Fri Jan 13, 2012 7:47 am
by Julio Jerez » Tue Jan 17, 2012 12:26 pm
The eassie way to do teh calculattion is in global space.
basically on entry to transform everything to global spase,
on exit you trsaform back to local.
when transforming to global space, there are tow posibilities, position are transformed, everything else is rotate (forces, normals, velocities)
-
Julio Jerez
- Moderator

-
- Posts: 12426
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by andygib » Tue Jan 17, 2012 5:18 pm
Hi ok thanks. So what your saying is to do all calculations in global space? and then transform the final force and torque to local space before applying to the body?
Andy
-
andygib
-
- Posts: 40
- Joined: Fri Jan 13, 2012 7:47 am
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 0 guests