Jump to content
  • Advertisement
Sign in to follow this  
tet3000

Basic 3D vector/movement question

This topic is 3592 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

Given an object w/ the following attributes: Position (Vector) Speed (Float) Direction (Unit Vector) I want to update my object's Position. If a Time component is also available(like amount of time passed since last Move update) am I thinking about this right? NewPosition(Vector) = Position + Speed * Time * (Direction) i.e. By Scaling the Direction unit Vector by multiplying it by Speed and Time does that leave me with a Vector that represents the amount of distance traveled? TIA

Share this post


Link to post
Share on other sites
Advertisement
Speed and Direction can be used together, they are a vector called Velocity.

Generally with velocity we call it magnitude and Direction. They can be drawn graphically as an arrow vector, where the length of the arrow is the vector magnitude and the direction is the direction indicated by the arrow.

The futuure position of an object is then:

dP = Vdt

Change in position = Velocity x Change in time

Where dt is your timestep, which for accuracy should ideally be an infinitesimal (smaller the better). So you would add the position change to your previous position to calculate a future position from velocity.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!