Skip to Content
Learn Three.js - Third Edition
book

Learn Three.js - Third Edition

by Jos Dirksen
August 2018
Intermediate to advanced content levelIntermediate to advanced
528 pages
10h 58m
English
Packt Publishing
Content preview from Learn Three.js - Third Edition

Using dat.GUI to make experimenting easier

A couple of employees from Google created a library called dat.GUI (you can find the documentation online at http://code.google.com/p/dat-gui/), which allows you to very easily create a simple user interface component that can change variables in your code. In the last part of this chapter, we'll use dat.GUI to add a user interface to our example that allows us to do the following:

  • Control the speed of the bouncing ball
  • Control the rotation of the cube

Just like we had to do for the statistics, we first add this library to the <head> element of our HTML page, as follows:

<script type="text/javascript" src="../../libs/util/dat.gui.js"></script>

The next thing we need to configure is a JavaScript ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-on Three.js 3D Web Visualisations

Hands-on Three.js 3D Web Visualisations

Nik Lever

Publisher Resources

ISBN: 9781788833288Supplemental Content