dat.gui

Saving parameters with dat.gui seems broken?

此生再无相见时 提交于 2021-02-07 13:18:49
问题 There seems to be a problem with saving parameters in dat.gui, or I'm missing something really obvious.. The problem shows when clicking the gear icon which should open a popup with the JSON to be saved. Also saving to local storage does not work for me. Here are two JSFiddles: http://jsfiddle.net/navFooh/XZcde/ with dat.gui.min.js, clicking the gear throws an error in the console: Uncaught TypeError: Cannot read property 'forEach' of undefined dat.gui.min.js:3 http://jsfiddle.net/navFooh

Three.js prevent Raycast through Gui

你说的曾经没有我的故事 提交于 2020-02-25 03:44:07
问题 I want to select objects with raycasting, but everytime i want to select something on the three.js gui, the Mousdownevent get triggered. How can i say something like "if the Gui is in front of the object, dont trigger" document.addEventListener( 'mousedown', onDocumentMouseDown, false ); function onDocumentMouseDown( event ) { if (event){} the gui is a normal three.js gui made like this: gui = new GUI( { width: 330 } ); 回答1: One way to solve this is with jQuery and an additional control

Is it possible to create a button using dat.gui

不问归期 提交于 2020-01-23 04:38:11
问题 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"); 回答1: This creates a button with text left aligned. var obj = { add:function(){ console.log("clicked") }}; gui.add(obj,'add'); 回答2: 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

OrbitControls and dat.gui text doesn't work

放肆的年华 提交于 2020-01-22 14:14:43
问题 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! 回答1: You need to pass the dom element you want to listen the events from. cameraControl =

OrbitControls and dat.gui text doesn't work

拟墨画扇 提交于 2020-01-22 14:12:12
问题 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! 回答1: You need to pass the dom element you want to listen the events from. cameraControl =

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

强颜欢笑 提交于 2020-01-11 10:54:52
问题 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

Three.js: Cannot change value in dat.GUI

不想你离开。 提交于 2020-01-05 10:32:08
问题 i have an instance of dat.GUI. I added a "comboBox" to that instance to make a selection of possible values. When i run my app, the dat.GUI appears with the comboBox but there is a problem: I cannot change it's default value (my gui is frozen), here is my code: <html> <head> <title>Stack Overflow</title> <style> body { margin: 0; } canvas { width: 100%; height: 100% } </style> </head> <body> <div id="container"></div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min

Refreshing dat.gui variable

怎甘沉沦 提交于 2019-12-24 01:10:48
问题 This is a dropdown list within a dat.gui interface. Once you click any number, the jumpSwitcher will be whatever number you chose. I’m trying to replace each list that pertains to their specific number based on that what the user chose for Starsystem . So solPlanets= ['Ilos', 'Tuchanka', 'Illium', 'Palaven'] is what shows in list 2 when you click on 2. On default, solPlanets shows ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune'] because default is jumpSwitcher =

Save dat.gui presets for dynamically added controls?

吃可爱长大的小学妹 提交于 2019-12-24 01:08:31
问题 I'm dynamically adding controls to a dat.gui interface, but the "save settings" functionality doesn't recognize them. var mygui = new dat.GUI(); mygui.remember(mygui); // standard way of adding a control mygui.control1 = 0.0; var control = mygui.add(mygui, 'control1', -1, 1); // adding controls dynamically var myArray = ['control2', 'control3']; var controls = []; for (x in myArray) { controls[myArray[x]] = 0.0; var newControl = mygui.add(controls, myArray[x], -1, 1); } The controls all work

dat.GUI - Looking for a way to lock slider and prevent updating of values with mouse into dat.GUI menu

放肆的年华 提交于 2019-12-23 17:03:50
问题 I try to implement a way to prevent the updating of values with mouse (actually when the three.js animation has started, launched with a click on button). For the moment, I have the following dat.GUI menu : Once "start" button is clicked, I would like to prevent user from modifying with mouse the parameters " Rotation x " and " Rotation y ". Here is the concerned part of code for this menu : // Create GUI var gui = new dat.GUI({ autoplace: false, width: 350, height: 9 * 32 - 1 }); var params