# Messing with transformations.

This topic is 3828 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I know: it should be a basic concept but... I need to represent a 3d world into a radar. The game is a space-sim and i want to implement a radar like the "elite/frontier" games. I want an ellipse, that represent the plane hosting my ship, and i want to represent the other ships using segments normal to the ellipse: the segment is over the ellipse if the enemy ship is over my head, the segment is under the ellipse if it's below. For example: look at this screenshot of the game i'm developing: The white segment represent an object (the space station) that is in front of me, at left edge, and a bit over the plane.. Ok? Now if i move the mouse down, and rotate the ship's nose up, i want that the segment become smaller until it reach the zero lenght: now my ship's plane contains the space station. If i raise the nose again, the segment should be have negative lenght: the space station is below the plane. Ok i need to implement this. What i want is the 3d transformation from universe coordinate to radar coordinate. On the 3d pipeline, the transformation is obtained from: worldMatrix * viewMatrix * projectionMatrix. I think that for the radar is: worldMatrix * viewMatrix i don't want the perspective correction, i need only to have the universe object coordinates relative to my ship position and my ship orientation. Now: using the formula above, seems to work for the x and z coordinate, but NOT for the y coordinate, aka the lenght of the segment. If the starship is in front of me and at the center of the screen i aspect to have a 0-lenght segment. If i move the ship down, i aspect that the segment grows, meanwhile the starbase goes up on the screen. Then, if i raise the nose, and put the starbase again at center of my screen, i should have again the segment with 0 size. No :( so i think i'm doing sometihing wrong. Is the formula incorrect? I'm missing something? Thanks.

##### Share on other sites
Assuming that worldMatrix denotes the transformation from the object's local co-ordinate frame to the global one, and viewMatrix (er, well, obviously) the inverse of the same transformation but for the camera (here the 1st person ship sight), then I don't see any reason why it shouldn't work principally for the local y axis as well. You may have to scale it down and to limit its length, but that's it. The problem must sit elsewhere.

##### Share on other sites
The invert!!!!

i've forget to invert it, arghhhh!!!!

Thank you very much! Now it works!

1. 1
Rutin
64
2. 2
3. 3
4. 4
5. 5

• 16
• 10
• 29
• 20
• 9
• ### Forum Statistics

• Total Topics
633414
• Total Posts
3011765
• ### Who's Online (See full list)

There are no registered users currently online

×