title: converting 3d position to 2d screen position
body: <p>I'd like to convert a 3d position into 2d screen position. I had a look at a similar question: <a href="https://stackoverflow.com/questions/519106/projecting-a-3d-point-to-a-2d-screen-coordinate">Projecting a 3D point to a 2D screen coordinate</a> , but I dont understand it completely. I thought in order to calculate the 2d position I would need the projection matrix, but I dont see how it is used, apart from converting a point into the location coordinate space. Besides, is cam.FieldOfView equal to farZ in OpenGL?</p>
  
  <p>Could someone please help me complete this function. Are the parameters sufficient to calculate the 2d position? Pos is already a vector relative to the camera position.</p>
  
  <pre><code>       Vector2* convert(Vector3&amp; pos, Matrix4&amp; projectionMatrix, int screenWidth, int screenHeight)
         {
              float ratio = screenWidth / screenHeight; 
  
              ...
  
              screenX = screenWidth * ( 1.0f - screenX); 
              screenY = screenHeight * ( 1.0f - screenY);    
  
              return new Vector2(screenX, screenY); 
         }
  </code></pre>