# Solvedplz help worldtoscreen

#### sosp

##### Newbie
i'm make esp

i know my coordinates x,y,z
i know enemy coordinates x,y,z
i know my mouse X,Y

i dont know worldtoscreen fuction

sry i'm not good at english

#### Rake

i'm make esp

i know my coordinates x,y,z
i know enemy coordinates x,y,z
i know my mouse X,Y

i dont know worldtoscreen fuction

sry i'm not good at english
You will need to find the viewmatrix also here is a tutorial on how to find it:

Last edited:

#### metrix

##### 0x90
Meme Tier VIP
Fleep Tier Donator
Trump Tier Donator
This is mine.

Note. It's for 1024*768 screen resolution. You should define a dynamic variable or just change it in the function.
Also there are several other/better ones in this forum via available.

C++:
``````bool WorldToScreen(Vec3D In, Vec3D& Out, float * ViewMatrix) {
Out.x = In.x * ViewMatrix[0] + In.y * ViewMatrix[4] + In.z * ViewMatrix[8] + ViewMatrix[12];
Out.y = In.x * ViewMatrix[1] + In.y * ViewMatrix[5] + In.z * ViewMatrix[9] + ViewMatrix[13];
Out.z = In.x * ViewMatrix[2] + In.y * ViewMatrix[6] + In.z * ViewMatrix[10] + ViewMatrix[14];
float w = In.x * ViewMatrix[3] + In.y * ViewMatrix[7] + In.z * ViewMatrix[11] + ViewMatrix[15];
//

if (w < 0.0)
return false;

Out.x /= w;
Out.y /= w;
Out.z /= w;

Out.x *= 1024 / 2.0f;
Out.x += 1024 / 2.0f;

Out.y *= -768 / 2.0f;
Out.y += 768 / 2.0f;

return true;
}``````

Attention! Before you post:

99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

• Fill out the form correctly
• Tell us the game name & coding language