flux-viewport
Version:
Flux viewport for visualizing geometry
32 lines (25 loc) • 791 B
HTML
<html>
<head>
<meta charset="utf-8">
<title>Flux Viewport</title>
<script src="../build/flux-viewport-bundle.global.js"></script>
</head>
<body onkeypress="focusAll()" onload="handleLoad()">
<h2>Flux Viewport</h2>
<div id="container" style="width:400px;height:400px;display:inline-block;background-color:#FFCCCC"></div>
<script>;
var sphere = {"origin": [0,0,0],"radius": 5,"primitive":"sphere"};
var fluxViewport = null;
function handleLoad() {
fluxViewport = new FluxViewport(document.querySelector('#container'));
fluxViewport.setupDefaultLighting();
fluxViewport.setGeometryEntity(sphere);
}
function focusAll() {
fluxViewport.focus();
}
</script>
</body>
</html>