Advertisement Jump to content
Sign in to follow this  
HoanNguyen

2D Curved Movement

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

Hello all,

I am new here, so my apologies if this topic has already come up. Basically, I wanted to know if someone could point me in right direction.

 

I am trying to move a ship in 2D space based on its current position, speed and new movement angle. So, I have a ship (moving through water) and it needs to move from its current position to a new position. I don't want the ship to just turn in the new direction and move to the new position. I want it to move to its new position in a normal arc like turn. I am currently working on a project in C# and wanted to know if someone knew of any code samples out the that would do this or point me in the right direction. Any help would be appreciated. Thank you!

Share this post


Link to post
Share on other sites
Advertisement

You may want to calculate a Bezier curve for the ship's path. But you'll need more information than you've given above. E.g., you need to pick a direction the ship will be traveling when it reaches the new position, etc. Also, it's not clear how you want to take the ship's speed into consideration.

Edited by Buckeye

Share this post


Link to post
Share on other sites

Basically what you're looking for is an interpolation formula. There are many to choose from, but I'd also recommend a bezier curve for your issue. A spline interpolation might also do what you want.

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.

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!