@masatomakino/threejs-position-util
    Preparing search index...

    @masatomakino/threejs-position-util

    threejs-position-util

    measuring geometry positions for three.js

    MIT License CI_Main Maintainability Test Coverage

    ReadMe Card

    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";
    

    API documentation

    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.

    MIT licensed.