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
});