title: Getting the real screen width in pixels of a div/image using Three.js and the CSS3DRenderer
body: <p>Really been struggling with this one.
  I have a program that uses the CSS3D Renderer of Three.js and I am trying to get projected "real" screen-width in pixels of a div (which contains a single image).</p>
  
  <p>I've tried using getBoundingClientRect() on the image but the widths and heights returned from that function are wrong. I assume due to a perspective issue.</p>
  
  <p>I have also tried this method which gives me an accurate center coordinate and is from this post by mrdoob: <a href="https://stackoverflow.com/a/11605007">https://stackoverflow.com/a/11605007</a></p>
  
  <pre><code>var width = window.innerWidth, height = window.innerHeight;
  var widthHalf = width / 2, heightHalf = height / 2;
  
  var projector = new THREE.Projector();
  var vector = projector.projectVector( object.matrixWorld.getPosition().clone(), this.camera );
  
  vector.x = ( vector.x * widthHalf ) + widthHalf;
  vector.y = -( vector.y * heightHalf ) + heightHalf;
  </code></pre>
  
  <p>Unfortunately all methods I am finding for getting the top,left corner or any corner of the object use Geometry objects which the CSS3DObject does not use (ie. getting the vector of the corner vertices and projecting those vectors ref: <a href="https://stackoverflow.com/a/14044103/2009076">https://stackoverflow.com/a/14044103/2009076</a>).</p>
  
  <p>Anyone have any idea of how to accomplish this? To be concise, I would just like to get the real on-screen size of a div (which fits tightly around its img) in a Three.js CSS3D scene. In the end I would like to detect if the camera zoom has made an image bigger than its original size in pixels.</p>
  
  <p>Thanks!</p>