Freelancer style radar

Started by
2 comments, last by hck 18 years, 10 months ago
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?
Advertisement
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.
Hey, good idea! I'll immediately try it out (if I am able to do the 3d->2D projection)
Did it!
Thanks for setting me thinking!

This topic is closed to new replies.

Advertisement