Skip to content

Instantly share code, notes, and snippets.

@haehn
Created October 13, 2023 12:29
Show Gist options
  • Save haehn/a9aa1e7aed4b3b5af34aa85b62d4a26e to your computer and use it in GitHub Desktop.
Save haehn/a9aa1e7aed4b3b5af34aa85b62d4a26e to your computer and use it in GitHub Desktop.
CS460 XTK+DAT.GUI
<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