Skip to content

Instantly share code, notes, and snippets.

@verma
Created March 23, 2014 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save verma/9717096 to your computer and use it in GitHub Desktop.
Save verma/9717096 to your computer and use it in GitHub Desktop.
PointCollector.prototype._2dProj = function(p, proj) {
proj = proj || (new THREE.Projector());
var ndc = p.clone();
proj.projectVector(ndc, this.fromCamera);
return new THREE.Vector3(
ndc.x * this.size[0] / 2, ndc.y * this.size[1] / 2, 1.0);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment