Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
camera-unproject
Advanced tools
Unprojects a 2D screen space point into 3D space using the inverse of your camera's combined matrix.
var mat4 = require('gl-mat4')
var unproject = require('camera-unproject')
//projection * view matrix
var combinedProjView = mat4.multiply([], projection, view)
//now invert it
var invProjView = mat4.invert([], combinedProjView)
//viewport bounds
var viewport = [x, y, width, height]
//2D point in screen space
//z=0 means "near plane"
var point = [123, 52, 0]
//vec3 output
var output = []
unproject(output, point, viewport, invProjView)
vec3 = unproject(out, point, viewport, invCombined)
Unprojects the 2D point
into 3D space using the viewport
bounds (screen x, y, width, height) and invCombined
matrix.
Where 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.
The [x, y, z]
result is stored in out
and returned.
MIT, see LICENSE.md for details.
FAQs
unproject 2D point to 3D coordinate
The npm package camera-unproject receives a total of 1,707 weekly downloads. As such, camera-unproject popularity was classified as popular.
We found that camera-unproject demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.