Hello, I've been stumped with the following problem (don't even know where to begin).
I would like to create a 2-D circular compass that displays the direction in which the observer is moving relative to the direction the observer is facing. The circular compass assumes that the positive y-axis represents ZERO degrees (not the positive x-axis in most mathematical circumstances). Thus everything will be adjusted by 90 degrees in the equations to follow.
For instance, if the yaw of the observer's camera, a, be equal to 135 but the direction of the observer's camera, d, be equal to 90, then the compass should point at -45 degrees, or d - a. This means the line would have the equation y = (arctan[d - a + 90])x, using the center of the compass as our origin.
Remember that this compass has nothing to do with North/south/east/west, it's a compass that always points north when the observer is facing the direction of his movement (although right now, I don't even know how to setup a regular compass)).
That only works in 4 directions though. Also, you would have to use facing of the unit instead of camera yaw (mine was built for 3rd person). But the basic idea is the same.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Ok I'm looking for a way to draw a 2-D line from a point on the screen to another point on the screen. This should be a better way of asking the question, as this is what truly boggles me.
Maybe use a dialog image and turn it to the angle you need? Assuming your line does not vary in size; which should be doable as well, but would certainly be more complex, if you indeed need to connect 2 points and a rotating bar does not suffice.
Hello, I've been stumped with the following problem (don't even know where to begin).
I would like to create a 2-D circular compass that displays the direction in which the observer is moving relative to the direction the observer is facing. The circular compass assumes that the positive y-axis represents ZERO degrees (not the positive x-axis in most mathematical circumstances). Thus everything will be adjusted by 90 degrees in the equations to follow.
For instance, if the yaw of the observer's camera, a, be equal to 135 but the direction of the observer's camera, d, be equal to 90, then the compass should point at -45 degrees, or d - a. This means the line would have the equation y = (arctan[d - a + 90])x, using the center of the compass as our origin.
Remember that this compass has nothing to do with North/south/east/west, it's a compass that always points north when the observer is facing the direction of his movement (although right now, I don't even know how to setup a regular compass)).
@EdwardSolomon: Go
Oh boy... I used this trigger for my assassins map.
here's the pastebin of the trigger.
That only works in 4 directions though. Also, you would have to use facing of the unit instead of camera yaw (mine was built for 3rd person). But the basic idea is the same.
@zeldarules28: Go
Taking a look now. Thanks. I'll get back to this in a few moments.
@EdwardSolomon: Go
Ok I'm looking for a way to draw a 2-D line from a point on the screen to another point on the screen. This should be a better way of asking the question, as this is what truly boggles me.
Maybe use a dialog image and turn it to the angle you need? Assuming your line does not vary in size; which should be doable as well, but would certainly be more complex, if you indeed need to connect 2 points and a rotating bar does not suffice.
@Kueken531: Go
Precisely what I needed. Here's the demo of what I made.