Here is the game Im designing and programming and what I would like is an idea of how to get a radar system in place that will show where ships are relative to the ship. An example would be fighter simulators that have radar dots that raise and fall below the fighter. I will paste a video of starcraft 2 that will have the radar I wish to make. I just need to have a general idea of how to setup such a thing.
I just need a basic rundown of how to convert their position to a small interface on my ship all I need help with is the math to convert ship position to a small 3d space as seen in the video here. I already have an array of gameobjects and I know the basic rundown of all that just need help with the math to setup the interface I plan on just using some small cubes for now to represent ships and spheres to represent fighters.
didn’t see a radar example at 4.09, but looks to me that you just need the positions of the ships realtive to your ship. If this is the case, then you can use worldToLocalMatrix or InverseTransformPoint. Then you would plot these relative positions in your radar.
No the starcarft video should have the example with the desk and ships zooming into the world but I will have a look at those functions. Also would I just scale down the number to the units on the radar or could I just use those functions and its done for me?
here is the video again but after looking at it… its actually at 4:25 you will see the Green Table and then after a bit 3 ships will zoom in to play
Create a new camera which follows the ship in X and Z but stays above it and constant in Y.
Make the camera shoot straight down and set it to orthographic.
Make a new Layer “Radar”
Set the new camera to this layer, and the main camera to exclude this layer. Also set the new camera to a higher priority (what is it called? ‘order’?)
make a sprite which follows everything you want to show up on radar, again so they face straight up, and put them in the Radar Layer.
You now have a camera which renders only dots which are following things around your ship. You can size it to fit in the corner, make some nice background and foreground images and move them in to place to make it pretty. You can make a sprite for the ship as well…make it ship-shaped if you want.
Move the camera higher to make the radar cover more territory (you can even let the player zoom in and out like this - scale the dots in proportion or let them get smaller as the camera rises)
If you want the radar to rotate with the ship, then just set it to use only the Y rotation of the ship’s quaternion.EularAngles (or whatever it’s called)
I have not tried this but I have thought about it a lot ;). This IS, however, the same rough idea I used to add life-bars to my enemies, so it should work fine. I’m using EZGUI* and SpriteManager2* for my sprites and progress-bars. and PoolManager* to spawn and reuse them.
(*For full disclosure, I developer PoolManager but am not affiliated with EZGUI or SpriteManager2)
well I don’t want the radar to be on the players screen I want to create a 3d object on the bridge which display the 3d objects on a scaled down map though my friend at dastardly Banana has helped me solve this issue so I will be implementing it within a few weeks or so