Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Moving an object in 3D space

This topic is 5739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!