#### Archived

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

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

## Recommended Posts

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
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....

##### Share on other sites
hmm... this formula doesnt look richt, perhaps my explanation wasnt so good.

i know the angle how far the other spaceship is away from center( dot(heading,vector_to_other_spaceship)), but i dont know the direction:-(

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632988
• Total Posts
3009738
• ### Who's Online (See full list)

There are no registered users currently online

×