Skip to main content
gamedev.net
🔒 Locked

Moving an object in 3D space

Started by Getty 1 reply 1k views
Original Post
Getty
Getty
If I have a object moving in a particular direction in 3D space and I want to change directions by applying force to that object, what formula would I need to find the resulting speed and direction?
TerranFury
TerranFury
deltaV = a * deltaT
a = F/m

Remember that you''re dealing with vectors. Check the tutorials on this website for more. Ideally, also find some basic physics websites and/or borrow a high school physics book.
grhodes_at_work
grhodes_at_work
From TerranFury''s post, F (force), a (acceleration), and DeltaV (change in speed) are vectors. m (mass) is a scalar constant. DeltaT is the time step. So, if v is your object''s current velocity (also a vector), you can find the new v by calculating the force, calculating a from the force, calculating DeltaV from a, and then:

v = v + DeltaV

Then, your new position can be calculated by:

Delta_position = v * DeltaT
position = position + Delta_position

I know that''s roughly described, but that is a quick and dirty physics system.

The particular use of deltaV = a * deltaT and v = v + deltaT is called "simple Euler integration." It is very easy to implement, but if you begin to do complex things such as connecting springs to your objects (spring force to cause objects to oscillate), this type of integration will begin to fail, and the simulation will overflow.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net

Topic Locked

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

Sign in to reply to this topic.