A package which create THREE.js controls on Dat.GUI
First install the npm package
npm install three-dat.gui
Or with yarn
yarn add three-dat.gui
Let's create a simple THREE.js example which display a gui controller for our THREE.MeshStandardMaterial
import Dat from 'dat.gui';
import init from 'three-dat.gui'; // Import initialization method
init(Dat); // Init three-dat.gui with Dat
/*
... init scene, renderer & camera
*/
var gui = new Dat.GUI();
var geometry = new THREE.BoxGeometry(1, 1, 1);
var material = new MeshStandardMaterial();
var mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
gui.addMaterial('standard_material', material);You can add quickly many kind of THREE.js objects.
THREE.Materialwithgui.addMaterial("name", material)THREE.Lightwithgui.addLight("name", light)THREE.Vectorwithgui.addVector("name", vector)THREE.Scenewithgui.addScene("name", scene)THREE.Object3Dwithgui.addObject3D("name", object)THREE.Meshwithgui.addMesh("name", mesh)THREE.Fogwithgui.addFog("name", fog)THREE.FogExp2withgui.addFogExp2("name", fog)
- Add helpers on
THREE.Object3D - Refactoring
- Climate