mardi 14 novembre 2017

ckecking and unchecking checkbox in dat.gui

I have a checkbox named autorotation.I want to mark that checkbox to false when user click any where 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.
}




Aucun commentaire:

Enregistrer un commentaire