Jump to content
  • Advertisement
Sign in to follow this  
jbosch

2D Vectors trajectory parametrization

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

Hi,

I want to move a 2d sprite in the screen.

I have 2 vectors: initial position (A) and end position (B).

I want to move the sprite from A to B in a straight line in T seconds.

¿How do I parametrize the trajectory? I mean, I supose I'll need to keep a "real position" vector value, how do I calculate it in each instant of T?

Thanks

Share this post


Link to post
Share on other sites
Advertisement
Your problem is a bit ambiguous since you've not told us 'how' you want it to move in a straight line (aka should it move with a constant speed etc :P)

In the simplest case (constant speed) you simply have a velocity of (B-A)/T which remains constant

Share this post


Link to post
Share on other sites
Quote:
Original post by luca-deltodesco
Your problem is a bit ambiguous since you've not told us 'how' you want it to move in a straight line (aka should it move with a constant speed etc :P)

In the simplest case (constant speed) you simply have a velocity of (B-A)/T which remains constant


thanks. I think its just what I need

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!