Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.


Coordinate System Troubles...

  • Please log in to reply
1 reply to this topic

#1 Ryan 3000

Ryan 3000

  • Members
  • 834 posts
  • Gender:Male
  • Location:Maryland
  • Local time:03:07 AM

Posted 29 May 2008 - 01:16 PM

I am making a game in XNA that involves missiles pointing in the direction of the object they are chasing. I know how to make it move at the right speed, but I cannot make it face the right direction. How can I convert a ratio of coordinates to a radian number?

For example: If I had a missile at 10, 10 and was aiming at 40, 100; how would I make the missile point at 40, 100?
No pessimist ever discovered the secrets of the stars, or sailed to an uncharted land.

BC AdBot (Login to Remove)


#2 groovicus


  • Security Colleague
  • 9,963 posts
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:07 AM

Posted 29 May 2008 - 05:29 PM

There is probably a C# library that will do that for you, but I wouldn't know which one right off hand. I know that the formula that you want is used in the 2D sample game. Did you work through that tutorial, or are you using tutorials off the web site?

The quick and dirty way to do it would be to just use trigonometry, but I am betting that someone on the XNA forums can probably help much more quickly than I can.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users