dat.gui

Drop down menu not work

北城余情 提交于 2019-12-22 07:04:14
问题 I'm developing an easy web application, and I'm using two js libraries: dat.gui and three.js. My problem is the drop down menu is locked. I can't open it. // gui initialization (dat.gui) function initGui() { var Options = function() { this.tenda = 'bar'; }; config = new Options(); var gui = new dat.GUI(); var subGui = gui.addFolder('Setting'); subGui.open(); // callbacks subGui.add( config, 'tenda', ['bar', 'pie', 'area']). onChange( function() { if (config.tenda === 'bar') { ... } else if

Method for disabling a button in dat.gui?

我只是一个虾纸丫 提交于 2019-12-21 11:55:14
问题 I am trying to figure out a way to easily disable/enable buttons within dat.gui. I have dat.gui set up to control an animation. When the animation reaches its end, I want the "Play" button to become disabled. I have tried adding a "disabled" attribute to the DOM elements of the button, but I am still seeing the corresponding function fire when the button is clicked after this attribute is set. My current method is the following: Locate the li element that corresponds to the button in the dat

refresh dat.gui with new values

隐身守侯 提交于 2019-12-20 09:17:35
问题 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. 回答1: 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(); For documentation, see: http://workshop

Three.JS- STL Loader - Uncaught TypeError: Cannot read property 'scale' of undefined

假如想象 提交于 2019-12-20 07:21:09
问题 I am loading five elements with STL Loader to create a table. I am trying to apply dat.gui to Tabletop.STL to adjust scale of it. Below is the code <!DOCTYPE html> <html lang="en"> <head> <title>three.js webgl - STL</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <style> body { font-family: Monospace; background-color: #000000; margin: 0px; overflow: hidden; } #info { color: #fff; position: absolute;

Dat.gui function invocation with parameters?

孤街浪徒 提交于 2019-12-13 04:43:16
问题 I am quite new with dat.gui . According to this little tutorial, you can invoke an object's function from the gui, just passing it to the gui's add function: gui.add(fizzyText, 'explode'); Is it possible to pass arguments to the explode function? Thanks! 回答1: It is not possible to pass arguments to a button's function. You can however access other properties of your object in that function: function myViewModel() { var self = this; this.name = "name1", this.score = 9, this.check = function()

Is it possible to create a button using dat.gui

微笑、不失礼 提交于 2019-12-04 23:02:50
I would like to create a button using dat.gui library. In a perfect world, this would work like this: gui.add("button", "click me"); Lonelydatum This creates a button with text left aligned. var obj = { add:function(){ console.log("clicked") }}; gui.add(obj,'add'); FWIW, dat.gui assumes the GUI type based on the target's initial value type. boolean => checkbox int/float => slider string => text input function => button Examples can be found here: http://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage 来源: https://stackoverflow.com/questions/18366229/is-it-possible-to-create-a-button

Method for disabling a button in dat.gui?

情到浓时终转凉″ 提交于 2019-12-04 06:14:32
I am trying to figure out a way to easily disable/enable buttons within dat.gui. I have dat.gui set up to control an animation. When the animation reaches its end, I want the "Play" button to become disabled. I have tried adding a "disabled" attribute to the DOM elements of the button, but I am still seeing the corresponding function fire when the button is clicked after this attribute is set. My current method is the following: Locate the li element that corresponds to the button in the dat.gui interface Create a new DOM element that is semi-transparent and black, and add this inside the li

dat.gui how to hide menu with code

醉酒当歌 提交于 2019-12-03 12:55:51
问题 I made a menu using dat.gui for my applcation with Three.js. It works fine, I have also discovered that pressing h key I can hide the menu created with dat.gui. My question is how can I make the menu appear/disappear directly from the code? var gui = new dat.GUI(); gui.add(text, 'message'); gui.add(text, 'speed', -5, 5); gui.??? I tried to use the property of the DOMElement hide and it works but I would like a unique way to handle this function. There is a function to call? I have noticed

OrbitControls and dat.gui text doesn't work

早过忘川 提交于 2019-12-03 12:43:34
I am using three.js and dat.gui with a text property. Also, I have OrbitControls in my scene: cameraControl = new THREE.OrbitControls(camera); cameraControl.update(); But there is a problem with this kind of scene. The text at the GUI doesn't work . You can't type anything in that box. And I have debugged it, and the problem is caused by OrbitControls. Do you know a way or workaround to solve it? Thanks! You need to pass the dom element you want to listen the events from. cameraControl = new THREE.OrbitControls(camera,renderer.domElement); Otherwise OrbitControls adds the events to the

Three.js & Dat.gui - TrackballControls renderer.domElement disables rotate and pan

﹥>﹥吖頭↗ 提交于 2019-12-02 01:15:33
I am trying to use dat.gui with a very simple three.js (r73) scene but am running into an issue with rotate and pan not working after adding "renderer.domElement" to the trackballControls initialization. Zoom works as expected. Without renderer.domElement, I get a working rotate, zoom, pan functionality but the dat.gui interface sliders "latch" when clicked, which is just annoying and not functional. The issue as described here: Issue while using dat.GUI in a three.js example . Looked over more info here but didn't see a great resolution: https://github.com/mrdoob/three.js/issues/828 Also