Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  HUD Radar for SpaceSim  (Read 1763 times)
0 Members and 1 Guest are viewing this topic.
Offline Conzar

Junior Devvie

There is nothing common about common sense

« Posted 2006-09-24 22:53:37 »

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.

Offline Conzar

Junior Devvie

There is nothing common about common sense

« Reply #1 - Posted 2006-09-28 02:02:05 »

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 = z*sin(Ry) + x*cos(Ry)
Where Cx is the x-axis position in the radar.

Cy = y*cos(Rx) - z*sin(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?

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Archive (90 views)
2017-02-27 19:41:49

Riven (83 views)
2017-02-27 17:26:59

numerical (450 views)
2017-02-21 07:32:16

numerical (455 views)
2017-02-21 07:31:46

theagentd (563 views)
2017-02-18 13:42:33

theagentd (559 views)
2017-02-18 13:35:16

h.pernpeintner (1734 views)
2017-01-24 22:39:11

h.pernpeintner (1689 views)
2017-01-24 22:38:32

Galdo (2271 views)
2017-01-12 13:44:09

Archive (2183 views)
2017-01-02 05:31:41
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!