C++:

```
typedef float ViewMatrix[ 16 ]; //Can be done different, i'm just using it like this
bool WorldToScreen( Vector from, Vector &to, ViewMatrix m_vMatrix )
{
to.x = m_vMatrix[ 0 ] * from.x + m_vMatrix[ 1 ] * from.y + m_vMatrix[ 2 ] * from.z + m_vMatrix[ 3 ];
to.y = m_vMatrix[ 4 ] * from.x + m_vMatrix[ 5 ] * from.y+ m_vMatrix[ 6 ] * from.z + m_vMatrix[ 7 ];
float w = m_vMatrix[ 12 ] * from.x + m_vMatrix[ 13 ] * from.y + m_vMatrix[ 14 ] * from.z + m_vMatrix[ 15 ];
if( w < 0.01f ) return false;
float invw = 1.0f / w;
to.x *= invw;
to.y *= invw;
float x = Resolution[ 0 ] / 2; // Resolution is my Global Variable which is holding the resolution of the game
float y = Resolution[ 1 ] / 2;
x += 0.5 * to.x * Resolution[ 0 ] + 0.5;
y -= 0.5 * to.y * Resolution[ 1 ] + 0.5;
to.x = x;
to.y = y;
return true;
}
```

C++:

```
//Before every WorldToScreen Call:
DWORD dwTemp;
ViewMatrix W2SMatrix;
ReadProcessMemory( hlProc, LPCVOID( dwClientDLL + 0x54BE14 ), &dwTemp, 4, 0 );
ReadProcessMemory( hlProc, LPCVOID( dwTemp + 0x22C ), &W2SMatrix, sizeof( ViewMatrix ), 0 );
//Then:
if( WorldToScreen( TargetPlayer->GetAbsOrigin( ), ScreenCoordinates, W2SMatrix ) )
{
//Draw Shit
}
```