Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 1365 times)
0 Members and 1 Guest are viewing this topic.
Offline Conzar

Junior Member




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.

Ubuntu
Offline Conzar

Junior Member




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?

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

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (20 views)
2014-09-21 02:42:18

BurntPizza (14 views)
2014-09-21 01:30:30

moogie (14 views)
2014-09-21 00:26:15

UprightPath (25 views)
2014-09-20 20:14:06

BurntPizza (27 views)
2014-09-19 03:14:18

Dwinin (42 views)
2014-09-12 09:08:26

Norakomi (73 views)
2014-09-10 13:57:51

TehJavaDev (96 views)
2014-09-10 06:39:09

Tekkerue (49 views)
2014-09-09 02:24:56

mitcheeb (70 views)
2014-09-08 06:06:29
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!