```
bool CMaths::WorldToScreen(vec3_t WorldLocation, vec3_t mypos, vec3_t viewAngles, vec3_t oaim, int screencenter[2], float fov[2])
{
Vect3d vLocal;
Vect3d vTransForm;
vec3_t aimAngles,vector3;
v3Right = new Vect3d;
v3Forward = new Vect3d;
v3Upward = new Vect3d;
AngleVectors1(viewAngles);
vLocal = SubVectorDistV(WorldLocation, mypos);
vTransForm.x = vLocal.dotproduct(*v3Right);
vTransForm.y = vLocal.dotproduct(*v3Upward);
vTransForm.z = vLocal.dotproduct(*v3Forward);
if (vTransForm.z < 0.01)
return false;
// how do i calculate the aim angle? :S
oaim[0] = vTransForm.x / 5.1;
printf("aim x : %f\n", oaim[0]);
system("cls");
// these work good and give me the screen (2d) coordinates
screenX = screencenter[0] + (screencenter[0] / vTransForm.z * (1 / fov[0])) * vTransForm.x;
screenY = screencenter[1] - (screencenter[1] / vTransForm.z * (1 / fov[1])) * vTransForm.y;
return true;
}
```