D
D
Dmitry2016-02-17 13:31:24
WebGL
Dmitry, 2016-02-17 13:31:24

Three.js - automatic rotation of the model. How to enable and disable it on demand?

In the three.js framework components there is a OrbitControls.js file.
In it, we set the model overview control parameters.
And there are lines like this:
THREE.OrbitControls = function ( object, domElement ) {
// Set to true to automatically rotate around the target
this.autoRotate = false;
this.autoRotateSpeed ​​= 2.0; // 30 seconds per round when fps is 60
};
I want to set a condition in JS so that when hovering over with the mouse, the model stops rotating.
How to actually change on demand this.autoRotate = false; on this.autoRotate = true; and vice versa

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2016-02-19
@se_demon

I will answer myself.
lesson6.controls.autoRotate = false;

N
Nicholas, 2016-02-17
@ACCNCC

Via Raycaster

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question