1.1.0 • Published 11 months ago

three-rotation-controls v1.1.0

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
11 months ago

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.
A negative value means the target will rotate in the opposite direction.

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

lerpFactor

Default: 0.1
Interpolation factor. A smaller value means a smoother rotation.

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

11 months ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago