Neglected Pizza Money

    three-rotation-controls

    1.0.2 • Public • Published

    three-rotation-controls

    Control class that rotates an object according to the position of the mouse.

    Install

    npm i three-rotation-controls

    Usage

    import RotationControls from 'three-rotation-controls'
    
    let controls = new RotationControls(targetObject);
    
    function loop() {
        requestAnimationFrame(loop);
        controls.update();
    }

    Options

    amp

    Default: 1
    Rotation amplication. A bigger value means the target will rotate more.

    new RotationControls(targetObject, {
        amp: 1.5
    });

    lerpFactor

    Default: 0.1
    Controls the smoothness of the rotation.

    new RotationControls(targetObject, {
        lerpFactor: .05
    });

    reverse

    Default: false
    Reverse the rotation.
    Example:

    new RotationControls(targetObject, {
        reverse: true
    });

    Install

    npm i three-rotation-controls

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    580 kB

    Total Files

    15

    Last publish

    Collaborators

    • thibka