Created
October 13, 2023 12:29
-
-
Save haehn/a9aa1e7aed4b3b5af34aa85b62d4a26e to your computer and use it in GitHub Desktop.
CS460 XTK+DAT.GUI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"> | |
<meta content="utf-8" http-equiv="encoding"> | |
<style> | |
html, body { | |
background-color: #000; | |
margin: 0; | |
padding: 0; | |
height: 100%; | |
overflow: hidden !important; | |
} | |
</style> | |
<script type="text/javascript" src="https://get.goXTK.com/xtk_edge.js"></script> | |
<script type="text/javascript" src="https://get.goXTK.com/xtk_xdat.gui.js"></script> | |
<script type="text/javascript"> | |
var r,c; | |
window.onload = function() { | |
r = new X.renderer3D(); | |
r.init(); | |
c = new X.cube(); | |
r.add(c); | |
r.render(); | |
var gui = new dat.GUI(); | |
var cubeGui = gui.addFolder('Cube'); | |
cubeGui.addColor(c, 'color'); | |
cubeGui.add(c, 'opacity', 0, 1); | |
cubeGui.add(c, 'visible'); | |
cubeGui.add(c, 'lengthX', 0, 200).onChange( function() { | |
c.color = [Math.random(), Math.random(), Math.random()]; | |
c.modified(); | |
}); | |
}; | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment