Having some trouble implementing DAT.gui
into my code for camera control in three.js
Included the following line in my index.html
file.
<script type='text/javascript' src='../_libs/DAT.GUI.min.js'></script>
Made sure to retrieve files from the build
folder.
However, when I added the below code snippet to my my.js
file:
var gui = new DAT.GUI();
gui.add(camera.position, 'x', -500,500).step(5);
gui.add(camera.position, 'y', -500,500).step(5);
gui.add(camera.position, 'z', 1000,5000).step(5);
An error message popped up saying TypeError: DAT is undefined
.
Even after attempting to switch to dat.GUI
with lowercase letters, the issue persisted. It appears that my.js
cannot locate DAT.GUI.min.js
, despite being able to find other necessary files. Why might this be happening?