• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

## Recommended Posts

cody    199
hi anyone knows the radar displays from privateer or wing commander? the middle of the radar screen is in front of you, the farer its away from the center the farer you must rotate to face it. a point in the most outer region is behind you. (dont know if anybody understands this...) i know the position of my spaceship, the rotation(quaternion) and the same of the spaceship to display on the radar. i can calculate the distance from the radar center to the displayed point by the dot product of the direction-vector of my spaceship and the vector from my spaceships position to the position of the other spaceship. but i dont know how to calculate the angle to rotate the point around the center.(if the other spaceship is left/right/up/down) hope somebody can help.

##### Share on other sites
Tjoppen    122
You´ll have to get the angle between the heading of the radar and that of the other ship:

  //It we say that the origin of our ship is (0,0,0), we do this://Note: To move the ship and other thing, substract the ship´s// origin from all ships´ originsfloat r = acosf( DotProduct( heading, ship.origin ) / (heading.Magnitude() * ship.origin.Magnitude() ) );

It you should be in 2d, it´s just the same....We just remove z from all calcs....