UNPKG

791 BHTMLView Raw
1<!doctype html>
2<html>
3<head>
4 <meta charset="utf-8">
5 <title>Flux Viewport</title>
6 <script src="../build/flux-viewport-bundle.global.js"></script>
7</head>
8<body onkeypress="focusAll()" onload="handleLoad()">
9 <h2>Flux Viewport</h2>
10 <div id="container" style="width:400px;height:400px;display:inline-block;background-color:#FFCCCC"></div>
11
12 <script>
13 'use strict';
14
15 var sphere = {"origin": [0,0,0],"radius": 5,"primitive":"sphere"};
16 var fluxViewport = null;
17
18 function handleLoad() {
19 fluxViewport = new FluxViewport(document.querySelector('#container'));
20
21 fluxViewport.setupDefaultLighting();
22
23 fluxViewport.setGeometryEntity(sphere);
24 }
25
26 function focusAll() {
27 fluxViewport.focus();
28 }
29 </script>
30</body>
31</html>