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
My answer does not reflect your question but will be helpful for others that programmatically change values within the 3d scene and need to update the GUI controls.
When you declare:
var cubeX = folder1.add( parameters, 'x' ).min(-100).max(100).step(1).listen();
you have declared parameters beforehand, e.g.
parameters = {
x: 0, y: 0, z: 0
}
Now you can listen to the key events or the appropriate event and change the values in the GUI like that:
window.addEventListener('keydown', function(event) {
if(event.keyCode == 88) { // x pressed
parameters.x++; // GUI value changed
cube.scale.x = parameters.x; // 3d object changed
}
}