HUD Radar for SpaceSim

Hello All.
I am trying to develop a radar for a Space Sim and was wondering if anyone knows of a good way of mapping radar objects’ 3d position to a 2d radar.
Let me try to clarify what I mean. The radar that I’m trying to implement is just like the radar used in games such as X-Wing, Tie-Fighter, Xwing vs Tie, and X-Wing Alliance. If you haven’t played any of those great games (go to the bargin bin and pick em up b/c they are worth a play), then I’ll describe how the radar works. You have 2 radar circles, one in each top corner.
One is used for the objects in front of your ship and one in the back. The objects in the front radar showed the position of the object in relation to the direction your ship is facing.

So if you are facing dead on the object, then the object will be in the middle of the radar. If the object is 90 degress left of where your facing, then in the radar the object will be all the way on the left in the middle of the circle.

Here is a screen shot of the current hud and in the top is where I will be drawing the objects in the radar.

Let me recap

  • I have the 3d position of the objects
  • I have the 3d position of my ship
  • I have the rotational information about all axis of my ship

Trying to map objects in the radar.

Thanks for the help.

Well I think I’m getting on the right track. Here is what i have so far.

The knowns that i have are the following
Player Position P(x,y,z)
Player Rotation R(x,y,z)
Object Positino O(x,y,z)

First translate a vector about the origin
x = Ox - Px
y = Oy - Py
z = Oz - Pz

Equation that sort of works
Cx = zsin(Ry) + xcos(Ry)
Where Cx is the x-axis position in the radar.

Cy = ycos(Rx) - zsin(Rx)
Where Cy is the y-axis positino in the radar

One potential problem is dealing with Z-axis rotations. I’m not sure how to account for that in these equations.

Any thoughts?