{"_id":"camera-unproject","_rev":"4-a186f3fda3e856522cf6c8c990fc46ee","name":"camera-unproject","description":"unproject 2D point to 3D coordinate","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"camera-unproject","version":"1.0.0","description":"unproject 2D point to 3D coordinate","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{},"devDependencies":{"gl-mat4":"^1.1.3","gl-vec3":"^1.0.3","tape":"^4.0.0","test-fuzzy-array":"^1.0.1"},"scripts":{"test":"node test.js"},"keywords":["project","vector","matrix","matrices","gl-vec","gl-vec3","gl-mat4","projection","unprojection","unproject","camera","3d","2d"],"repository":{"type":"git","url":"git://github.com/Jam3/camera-unproject.git"},"homepage":"https://github.com/Jam3/camera-unproject","bugs":{"url":"https://github.com/Jam3/camera-unproject/issues"},"gitHead":"3825fa1115b11c1e1b0a946dadf2765b09444982","_id":"camera-unproject@1.0.0","_shasum":"b152f94b9975e2fecdf9a27d011cc6cd018e0980","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"b152f94b9975e2fecdf9a27d011cc6cd018e0980","tarball":"https://registry.npmjs.org/camera-unproject/-/camera-unproject-1.0.0.tgz","integrity":"sha512-zMV80Skv60NrYQ6NWCUi71RLI8vr3gtOX1/S9S+PuRTachW5WLMm8TeAE+6vDgBqQQz96J9JcLcL9D1vLPBi7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCm1ba9iK+YusP06YqC+C+chflhzBIyqFNt9vneJZuaJgIgFwJpxgD489qV8W+P09rWFcVp5LKqb/zK6QEX1ECOqBY="}]},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}]},"1.0.1":{"name":"camera-unproject","version":"1.0.1","description":"unproject 2D point to 3D coordinate","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{},"devDependencies":{"gl-mat4":"^1.1.3","gl-vec3":"^1.0.3","tape":"^4.0.0","test-fuzzy-array":"^1.0.1"},"scripts":{"test":"node test.js"},"keywords":["project","vector","matrix","matrices","gl-vec","gl-vec3","gl-mat4","projection","unprojection","unproject","camera","3d","2d"],"repository":{"type":"git","url":"git://github.com/Jam3/camera-unproject.git"},"homepage":"https://github.com/Jam3/camera-unproject","bugs":{"url":"https://github.com/Jam3/camera-unproject/issues"},"gitHead":"48c94ad11334c046aef65f406f8dfabce7d6f2a0","_id":"camera-unproject@1.0.1","_shasum":"86927a9d6d5340a8c9e36da840f7ccb6d6da12cf","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"86927a9d6d5340a8c9e36da840f7ccb6d6da12cf","tarball":"https://registry.npmjs.org/camera-unproject/-/camera-unproject-1.0.1.tgz","integrity":"sha512-IAta9EeGGa9rLJsw9Fk0lrZycDg2fF6nl6AvJ+QrkROxc4IaawosU9PQjoqgFYrOe1+kqJlod/W2TAZkTpxZQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH9U0o5gxTCf3XQnFaiYwR/GlmouekZY9moC7Ky5SPb3AiEA2FQpoBigETdjqwBOAKX0xkF4WMHH2D4B5CEDskuXyrA="}]},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}]}},"readme":"# camera-unproject\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nUnprojects a 2D screen space point into 3D space using the inverse of your camera's combined matrix.\n\n```js\nvar mat4 = require('gl-mat4')\nvar unproject = require('camera-unproject')\n\n//projection * view matrix\nvar combinedProjView = mat4.multiply([], projection, view)\n\n//now invert it\nvar invProjView = mat4.invert([], combinedProjView)\n\n//viewport bounds\nvar viewport = [x, y, width, height]\n\n//2D point in screen space\n//z=0 means \"near plane\"\nvar point = [123, 52, 0]\n\n//vec3 output\nvar output = []\n\nunproject(output, point, viewport, invProjView)\n```\n\n## Usage\n\n[![NPM](https://nodei.co/npm/camera-unproject.png)](https://www.npmjs.com/package/camera-unproject)\n\n#### `vec3 = unproject(out, point, viewport, invCombined)`\n\nUnprojects the 2D `point` into 3D space using the `viewport` bounds (screen x, y, width, height) and `invCombined` matrix. \n\nWhere `point` [x, y, z] uses window coordinates for XY and a range between 0.0 (near plane) and 1.0 (far plane) for Z. `invCombined` is typically the invert of the combined `projection * view` matrix for your camera. \n\nThe `[x, y, z]` result is stored in `out` and returned.\n\n## See Also\n\n- [camera-project](https://www.npmjs.com/package/camera-project)\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/Jam3/camera-unproject/blob/master/LICENSE.md) for details.\n","maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"time":{"modified":"2022-06-13T05:30:38.361Z","created":"2015-05-14T20:41:02.243Z","1.0.0":"2015-05-14T20:41:02.243Z","1.0.1":"2015-05-14T20:42:04.264Z"},"homepage":"https://github.com/Jam3/camera-unproject","keywords":["project","vector","matrix","matrices","gl-vec","gl-vec3","gl-mat4","projection","unprojection","unproject","camera","3d","2d"],"repository":{"type":"git","url":"git://github.com/Jam3/camera-unproject.git"},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"bugs":{"url":"https://github.com/Jam3/camera-unproject/issues"},"license":"MIT","readmeFilename":"README.md"}