I have a checkbox called autorotation that I would like to set to false when the user clicks anywhere in the scene...
controller = new function() {
this.autorotation=true;
}
var gui = new dat.GUI();
f1 = gui.addFolder('Sphere');
autorotation=controller.autorotation;
q=f1.add(controller, 'autorotation').listen().onChange( function()
{
autorotation=controller.autorotation;
});
function onDocumentMouseDown(event)
{
controller.autorotation=false;
//stop autorotation and uncheck the box.
//user may check the box for rotation manually by clicking on checkbox.
}
This code is functioning as intended. I am able to uncheck the checkbox through the code by setting Controller.autorotation=false, but it does not completely stop auto rotation. If I manually stop rotation with autorotation=false, then I need to click on the checkbox twice to check it to true.