Sign in to follow this  
hck

Freelancer style radar

Recommended Posts

Hi there! For my 3D space shooter, I would like to implement a radar system, similar to that in the game Freelancer. Here's a screenshot: http://www.4gamer.net/patch/demo/freelancer.jpg Whenever an enemy is not inside your viewing frustum, there should be an arrow pointing to its position, like the little red triangles on the picture. If you face the enemy so you can see it in front of you, the arrow should disappear and selection brackets are drawn around the enemy. Has anyone done that sort of radar? I already did a standard radar showing the enemies around you from a top view. Is it any similar? I think I have to use the projection of the viewing matrix to transform the position vectors of all enemies, right?

Share this post


Link to post
Share on other sites
This is easy to do, as it is basically a 2D problem. Project the enemy position onto the screen plane; let's call this point P. If P is inside the screen boundaries, draw the bracket around it. If it is outside, draw an imaginary line from the center of the screen to P and find the intersection with the screen boundaries. That's where you should draw the triangle.

Share this post


Link to post
Share on other sites
Hey, good idea! I'll immediately try it out (if I am able to do the 3d->2D projection)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this