Julio or anyone. Forces and Torque help?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Julio or anyone. Forces and Torque help?

Postby Gibbon » Fri Mar 11, 2011 9:38 am

Ok Joe, ill ask leadwerks but..

What leadwerks also does is automatically create convex hulls for you. So for complex models (like an airplane) it will create it automatically.

thanks
Andy
Gibbon
 
Posts: 44
Joined: Tue Dec 15, 2009 5:18 am

Re: Julio or anyone. Forces and Torque help?

Postby Gibbon » Fri Mar 11, 2011 7:48 pm

I think its give up time.

Reason being:
1.either i am over complicating this or it is just to complicated for me. I must have over 30 different attempted projects now and NONE of them have even remotly resemble the movement of an airplane, so somthing is wrong!
2.somthings i dont understand and so when its not working, im not 100% sure where the errors might be!

Here are few basic NGD things that i still do not understand...
1.When adding forces to a body like a plane where the basic forces there are 4 of (lift,drag,weight,thrust), do i in my game loop actually add 4 forces all in different directions? Or sum them all up into one and add that force?
2.I still dont get the torque thing? I think this is because when julio was trying to explain it to me he thought i was using a single body, so to "rotate" the airplane then you need to apply torque, whereas i was using a body for each wing and applying a force to each wing body which i thought would CREATE torque and rotate the airplane?? Is this not a possible way?

Its so so fustrating. All i want for now is the very basic, so a "body or bodies" move forward and i can pitch, roll & yaw.

Andy
Gibbon
 
Posts: 44
Joined: Tue Dec 15, 2009 5:18 am

Re: Julio or anyone. Forces and Torque help?

Postby Julio Jerez » Fri Mar 11, 2011 8:49 pm

Gibbon wrote:Here are few basic NGD things that i still do not understand...
1.When adding forces to a body like a plane where the basic forces there are 4 of (lift,drag,weight,thrust), do i in my game loop actually add 4 forces all in different directions? Or sum them all up into one and add that force?
2.I still dont get the torque thing? I think this is because when julio was trying to explain it to me he thought i was using a single body, so to "rotate" the airplane then you need to apply torque, whereas i was using a body for each wing and applying a force to each wing body which i thought would CREATE torque and rotate the airplane?? Is this not a possible way?

These are the root of the problems, you need a basic course on vector algebra so that you undertand how it applies to physics.
Adding forces and toque is a basics 101 physics principle that you can only undertand when you undertand vector algebra.
It will not do you any good, but these is hwo it works.

-the sum of two vectors is another vector formed by adding the individual compenents, component by component
-a Force is vectors.
so the sum of two forces is another force equal to the vector formed by adding them component wise.

-A force applied to a point on a rigid body, is the equivalent of the same force applied at the center of mass of that body plus a torque given by calculating the cross product
of the vector distance from the center of gravity to the point of action of the force.
-All torques act on the center of mass of the body.
-Torque are vectors, so all the rules of vetors algebra apply.

To apply and set of forces to a body all you need to do is this,
say the forces are F1, f2, ...
the origin of the body is O
and the point of action of each force is p1, p2, ...

the total force is:

F = F1 + F2 + ....
the total toque is
T = (P1 - O) x F1 + (P2 - O) x F2 + ....

x is the cross product operator

as you can see this is all Vector algebra applied to elementary physics Laws.
but you need to have the basics background, because I do not know how to explain it any easier.

One of the reason I do not write paper and give these kind of explanation is because I do not want people to confuse Newton engine with college Physics,
Newton is not the place to learn basics physics and math, the place for that is Text Books and schooll

Me giving you the solution of how the Vector algebra is used to solve physics problem does more harm than good to a person who is not prepared.
normally in school you will get an Algebra class were you learn what Vectors, Dot product, Cross product, Matrices, Derivatives, Integration, plus some more things in insulation.
you also learn Laws that those fundamental things obey like transitivity, commutative, assosiactivity, linearity, and so on.
Then in a next year or a semester you take Physics and you see how those Laws and those concepts apply to physics.
if you come here not knowing any of that, or worse with a vague idea, it confuses you even more because you need to be clear of that, me giving it to you medes stuff it more confusing.

I already gave you the outline of how to go about implement your simple airplane model, but you find it too difficult because you do not have the basic understanding of fundamental algebra.
My suggestion to you, is that you put this project on hold, and if you really are motivated, take a basics course on vector Algebra maybe get a basic book, (without the goal of learning how to make airplanes model)
and after that another class on Physics basics physics, It will not teach you how to make the airplane, but you will be able to follow the simple explantions of for how to use a tool.
In the end Newton is just that a tool, so is a graphics engine, if you do not know the basics you will use it baddly.
It is the only way you will be able to make it.
I am sorry I have to tell you like that, but it is the truth.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Julio or anyone. Forces and Torque help?

Postby JoeJ » Sat Mar 12, 2011 5:35 am

Learning algebra AND simulation at once is much.
I did not learn anything of that in shools, all by myself thanks to the internet.
It took me months to figure out, why somewhat complicated like a matrix is required to rotate a simple point in 3D.
Do not expect to get all running in days / weeks, but also don't give up.

Your code does not look so bad and you've learned a lot.
But it seems you're trying to do all at once and if it doesn't work you're stuck and unsure about the wrong things.
Typically i type 3 lines, try it out and realize that i've done something wrong, fix it and proceed.
You allways need methods to proof every simple and small thing.
Such methods for me are visualisation, a system to change a lot of values at real time that i can plug in at any current code, debugging.
Put as much time as possible into developing this methods, it's boring, but reuseable forever and anything.
Maybe C is better for that than Lua - don't fear C, all languages are pretty the same.

Simplifications in your case would be:
No gravity
use simple box and get some steering working first, then care for shape.
maybe sometimes set velocities instead of forces (not good but easier)

You will be able to do that, feel successfull, and your brain will accept and reuse the things you've learned :)

Good luck!
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron