whs-module-dat.gui - User Interface for runtime editing properties
Simple configuration
constsphere=newWHS.Sphere({material: newTHREE.MeshBasicMaterial({color: 0xffffff}),modules: [newDatGUIModule({name: 'MySphere',// name of folder for this componentmaterial: true// use material})]});
Advanced configuration
constsphere=newWHS.Sphere({material: newTHREE.MeshBasicMaterial({color: 0xffffff}),modules: [newWHS.mesh.DynamicGeometryModule(),newDatGUIModule({name: 'MySphere',material: true,geometry: true,// Update geometry parameterstryMaterial: [// Beta feature. Allows you to change material to the one of the followingTHREE.MeshBasicMaterial,THREE.MeshLambertMaterial,THREE.MeshPhongMaterial],custom: {// custom parametershello: (value,component)=>{// onChange function console.log(value);}},defaults: {// Default values for "custom"hello: 1},range: {// min and max for "custom"hello: [0,10]},step: {// steps for "custom"hello: 2}})]});
geometry parameter requires WHS.mesh.DynamicGeometryModule to be set before DatGUIModule.
Screenshot
Todo
Make ability to use several components. Add DatGUI to App
Make tryMaterial change without reloading material folder