使用新值刷新dat.gui [英] refresh dat.gui with new values
问题描述
我想用新值刷新dat.gui菜单。我已经加载了一个模型并在文件夹中显示gui文件夹中对象的名称。
当我重新加载其他模型时,如何显示新的对象名?
或者它是可以重置/清除gui。
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 object name when I reload a other model ?
Or it's possible to reset/clear the gui.
推荐答案
基本上,你必须在添加控制器时将控制器设置为监听输入,例如,
Basically, you have to set the controllers to "listen" for input when you add them, for example,
gui = new dat.GUI();
var guiX = gui.add( parameters, 'x' ).min(0).max(200).listen();
有关文档,请参阅:
< a href =http://workshop.chromeexperiments.com/examples/gui/#9--Updating-the-Display-Automatically> http://workshop.chromeexperiments.com/examples/gui/#9--更新-the-Display-Automatically
有关Three.js的示例,请参阅:
For an example of this in Three.js, see:
http://stemkoski.github.io/Three.js/GUI-Controller.html
这篇关于使用新值刷新dat.gui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!