• Create Account

## 2D Curved Movement

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

### #1HoanNguyen  Members

104
Like
0Likes
Like

Posted 22 February 2014 - 08:51 PM

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!

### #2Buckeye  GDNet+

10739
Like
0Likes
Like

Posted 22 February 2014 - 11:00 PM

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, 22 February 2014 - 11:01 PM.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

### #3TheComet  Members

2672
Like
0Likes
Like

Posted 23 February 2014 - 05:55 AM

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.

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.