refresh dat.gui with new values

前端 未结 8 1402
时光取名叫无心
时光取名叫无心 2021-01-31 19:55

I would like to refresh the dat.gui menu with new values. I have loaded a model and display in folder the name of the objects inside a gui folder.
How can I display the new

8条回答
  •  庸人自扰
    2021-01-31 20:07

    listen has a bug associated with it, if you use dropdown menus. See here: https://code.google.com/p/dat-gui/issues/detail?id=59

    Here's a short function to update all controllers by iterating through all folders.

    function updateDisplay(gui) {
        for (var i in gui.__controllers) {
            gui.__controllers[i].updateDisplay();
        }
        for (var f in gui.__folders) {
            updateDisplay(gui.__folders[f]);
        }
    }
    

提交回复
热议问题