@masatomakino/threejs-spherical-controls
    Preparing search index...

    @masatomakino/threejs-spherical-controls

    threejs-spherical-controls

    Spherical camera controller for Three.js

    MIT License build test Maintainability Test Coverage

    ReadMe Card

    Demo Page

    npm install @masatomakino/threejs-spherical-controls --save-dev
    

    threejs-spherical-controls is composed of ES6 modules and TypeScript d.ts files.

    At first, import classes.

    import { SphericalController } from "@masatomakino/threejs-spherical-controls";
    
    const cameraTarget = new Mesh(new SphereGeometry(1));
    scene.add(cameraTarget);

    const cameraController = new SphericalController(camera, cameraTarget);
    cameraController.initCameraPosition(
    new Spherical(radius, 0, 0), // => North Pole
    );
    cameraController.move(
    new Spherical(radius, Math.PI, 0), // => South Pole
    );

    API documents

    MIT license