measuring geometry positions for three.js
HEALTH ? 100 / Healthy
measuring geometry positions for three.js
// readme
Convert 3D Three.js world coordinates to 2D screen positions for UI overlays
View the Demo page and open the browser console.
Vector3
x: 960
y: 540
z: 0
threejs-position-util converts a 3D geometry position to 2D screen coordinates (CSS pixels; origin at top-left), ideal for positioning HTML UI elements over 3D objects.
npm install @masatomakino/threejs-position-util --save-dev
Import the named exports from the package root:
import {
get2DPosition,
get2DPositionWithMesh,
getGeometryCenterInWorld,
getGeometryCenterInLocal
} from "@masatomakino/threejs-position-util";
This package is ESM-only; CommonJS require() is not supported.
The main purpose of this library is toβ¦