Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Creating GUIs

Michael Chang edited this page Oct 21, 2016 · 2 revisions

GUIs in GUIVR are similar to folders in regular dat gui. You create one and you can attach any number of controllers to them.

In GUIVR, GUIs are Object3Ds that should be added to the scene

  const gui = dat.GUIVR.create( 'settings' );
  scene.add( gui );

You can still position, scale, and rotate these GUIs.

Next, you can add controllers to them:

  controller = gui.add( state, 'radius', 1, 20 );

The returned controller is a THREE.js object, so you can re-position or add them elsewhere on your scene.

To add an existing controller to a GUI (any number of them), you do

  gui.addController( controller1, controller2, controller3, controller4, etc );

For the time being you can't nest GUIs like folders.

Clone this wiki locally