Jump to content
  • Advertisement
Sign in to follow this  
middy

Scanner

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

Well I am doing a scanner for my 3D space-game. The scanner can be seen as a sphere and it reports all ships within that sphere. This is easy to implement, BUT I want to make it work like an old fashioned scanner. Where an arm is moving around and objects are only updated when the arm is passing them. How would I implement such a 360 degree scan? Perhaps I could cheat?, Example: Two ships are within scan range. I only update their position say every 3rd sec while I run an appropiate animation. Only problem is to sync the animation with the ships position.. eg arm passes position ship appears.. uuhm

Share this post


Link to post
Share on other sites
Advertisement
Work out the angle from the player ship to the enemy ship.
Base the animation frame on the angular distance away from the angle of the rotating radar.
So if you have a 15 frame animation, use frame 0 when difference between ship angle and scan angle is -7deg, frame 8 when its at 0deg, frame 15 when its at +7deg (for example). Anything outside the range isn't shown on the scanner. Watch out for 359deg equalling -1deg (wrap around).

Hope that helps.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!