Menu
  • HOME
  • TAGS

OrbitControls and dat.gui text doesn't work - SOLVED

javascript,three.js,dat.gui

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 document and that conflicts with DAT.GUI....

dat.gui load settings from external JSON?

javascript,json,user-interface,dat.gui

I've created an example (using dat.gui version 0.5) which demonstrates loading preset values from a JSON file on the initialisation of a dat.GUI object: http://codepen.io/BenSmith/pen/lxiqb The key part of the code which "re-hydrates" the dat.GUI object is this: var json = '{ \ "preset": "Default",\ "closed": false,\ "remembered": {\ "Default":...

Cannot initialize dat.GUI in Three.js

javascript,three.js,dat.gui

Solution: Don't use Internet Explorer, i run the same code in Firefox and it works.

customize shape of geometry with dat.gui

three.js,dat.gui

Create your squareGeometry in your fillscene function. Then, looks like you want to change the x coordinates of 2 vertices to some value. Do so in the animate: function animate() { window.requestAnimationFrame(animate); squareGeometry.vertices[0].x = whatever; squareGeometry.vertices[3].x = whatever; squareGeometry.verticesNeedUpdate = true; // ask for an update render(); } No need...

Load a file using a dat.GUI button?

javascript,html,input-type-file,dat.gui

(Based on Programmatically trigger "select file" dialog box) You call the hidden input button from the dat.GUI button's function. You need to use the jQuery library to make it work <input id="myInput" type="file" style="visibility:hidden" /> <script> var params = { loadFile : function() { $('#myInput').click(); } }; var gui =...

Three.js: Cannot change value in dat.GUI

javascript,three.js,dat.gui

Solution: If you use a mouse-controlled camera with three.js, you have to comment the following line in the MouseListener of the mouseDown action: event.preventDefault(); ...

Save dat.gui presets for dynamically added controls?

javascript,json,dat.gui

The lines in the for loop should be: mygui[myArray[x]] = 0.0; var newControl = mygui2.add(mygui, myArray[x], -1, 1); The first parameter of the add function performs two functions: it is both the source of the second parameter (the name of the control to be added, which in this case is...

How to get dat.gui controller type?

javascript,types,controller,dat.gui

You're right, there doesn't seem to be a type property which states the type of controller. However you do obviously already know what the types are as you define them in the dat.GUI property object (i.e. a boolean value is a checkbox etc.). You can though determine the type of...

How to add tooltips to dat.gui

javascript,user-interface,dat.gui

You will need to add this capability to dat.GUI yourself. Here are some guidelines and an example solution. Entries are represented with classes that are inherited from the Controller class. Each controller has a private member __li, that represents its <li> element in the gui. You can extend the Controller...

Mystery letters in a javascript object summary in Chrome's console

javascript,google-chrome,dat.gui

As mentioned by commenters, those are the names of constructor functions – but in this case, those names have been inferred by Chrome's V8 engine, and assigned for your convenience in the console, as explained in this answer: How does DevTools determine an object's constructor's name? In all likelihood, those...