Converting World Coordinates to Screen Coordinates?

Technical Discussions not Related Directly to MHS. For Example, Coding, Hex Editing, General Hacking, Etc.

Moderators: g3nuin3, SpeedWing, WhiteHat

Converting World Coordinates to Screen Coordinates?

Postby iOr » Mon Aug 02, 2010 8:31 pm

I have been playing several FPS games now, most of which I have been able to find the following information:

* Pitch, yaw, roll (of my character)
* X, Y, Z (of my character)
* X, Y, Z (of enemy)
* Name of enemy (and usually will find his health, armor, ammo, etc near the name)


With a little modifications, I usually have a simple (not accurate, but simple) aimbot use all of the above information. I never actually used anything from D3D API to display or change anything in a game (for the Direct3D games of course).

However I want to display the name of enemies with text on the enemy position. Now for 2D games I find this extremely simple ((1366 * enemyX) / gameWidth) = Screen X coordinate, 1366 is a constant for my screen width).

But 3D games have X, Y, and Z. How would I find the the required screen coordinates if I have there world space coordinates?

(Would I need "Camera FOV" or Camera coordinates, I haven't been able to find FOV for any game but camera coordinates should correspond somewhere close the player coordinates I assume)

(Sorry if this post may seem vague, or if the answer is a simple calculation, I am mediocre on the subject)

Here is a picture of what I mean:
Image
iOr
I Have A Few Questions
 
Posts: 5
Joined: Mon Aug 02, 2010 5:41 am

Return to Technical Unrelated

Who is online

Users browsing this forum: No registered users and 2 guests

cron