Jump to content

  • Log In with Google      Sign In   
  • 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.


  • You cannot reply to this topic
2 replies to this topic

#1 HoanNguyen   Members   -  Reputation: 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!



#2 Buckeye   GDNet+   -  Reputation: 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.


#3 TheComet   Crossbones+   -  Reputation: 2531

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.


"Windows 10 doesn't only include spyware, it is designed as spyware" -- Gaius Publius, The Big Picture RT Interview

"[...] we will access, disclose and preserve personal data, including your content (such as the content of your emails, other private communications or files in private folders), when we have a good faith belief that doing so is necessary" -- Windows 10 Privacy Statement





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.




PARTNERS