I was wondering how I could go about making a compass similar to this:
As you can see, as I angle my ship further away from a target, the vertical line on the compass gets longer.
Any help would be great
I was wondering how I could go about making a compass similar to this:
As you can see, as I angle my ship further away from a target, the vertical line on the compass gets longer.
Any help would be great
Think about why the developer made it that way. Those little lines are supposed to tell you if you are above the target or not. They are essentially a measure of the angle of your ships lookVector and the line formed from the ship and the destination. You can use atan2 to find not only the angle, but also unlike acos(dot(a,b)), the direction too so that you can have it be facing up or down and then the length is basically the ratio between the absolute angle over 180. then for their position on the circle I think a way to do it would be to make a plane around the horizon of the ship and then form a line which is 90 degrees with this plane and comes from the destination. Find their intersection point then from there use that function which takes a 3d point and converts it to the point on the screen then just get that calculated point on the screen and remap it to that tiny circle
I learned how to do this by breaking down some other program. This is very complicated.