measuring geometry positions for three.js
View Demo Page and open console.
Vector3
x: 960
y: 540
z: 0
threejs-position-util output a geometry position on screen.
npm install @masatomakino/threejs-position-util --save-dev
At first, import a class.
import { PositionUtil } from "@masatomakino/threejs-position-util";
Call static functions in PositionUtil class.
PositionUtil.getGeometryCenterInWorld(mesh);
PositionUtil.getGeometryCenterInLocal(mesh);
PositionUtil.get2DPositionWithMesh(mesh, camera, W, H);
Functions return a position as THREE.Vector3.
see also demo page.