Jump to content

Recommended Posts

Posted

You'll have to be more specific. The answer to your question is "via keyboard"...

 

First you have to know which physical law you want to implement. Then, depending on the program, you implement it. For example, here is the pseudocode of a way to introduce gravitation movement in a number of objects:

 

For every Object 0 to x
 For every object ahead of CurObject //In the list of objects
   Acceleration = NewtGravConst * NxtObject.mass / DistanceBetween[CurObject, NxtObject[math]]^2[/math]
   Velocity = Acceleration * DeltaTime
    Displacement = Velocity * DeltaTime
 EndLoop
EndLoop

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.