Screen hit indicator
Hi
In many fps when your shoot you get an indicator on screen that tells you where the opponent that shoot you is positioned. How would you go about translating that angle to a position on screen to show the indicator?
Thanks
Quote:Original post by Andreas Persson
How would you go about translating that angle to a position on screen to show the indicator?
1) Which angle?
2) What kind of indicator do you want? A triangle at the edge of the screen pointing in the appropriate direction? A triangle just at one of the 8 compass points? A dot where the enemy would be in the environment if you could actually see him? A dot on a radar in the HUD? Or just what?
Quote:Original post by ZahlmanQuote:Original post by Andreas Persson
How would you go about translating that angle to a position on screen to show the indicator?
1) Which angle?
2) What kind of indicator do you want? A triangle at the edge of the screen pointing in the appropriate direction? A triangle just at one of the 8 compass points? A dot where the enemy would be in the environment if you could actually see him? A dot on a radar in the HUD? Or just what?
Sorry for not being clear enough. The angle from the players LookAt to the position of the enemy (might not need that).
The type of ndicator I am looking for is: A triangle at the edge of the screen pointing in the appropriate direction.
Project the vector-to-attacker onto the player/camera forward vector, take the perpendicular of that, then normalize it. Then transform to camera space and use the result however you want.
If you want a direction indicator from the top-down perspective (i.e. "down" indicates that you were shot from behind) then use the player or world 'up' vector instead of his forward vector.
If you want a direction indicator from the top-down perspective (i.e. "down" indicates that you were shot from behind) then use the player or world 'up' vector instead of his forward vector.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement