-
Notifications
You must be signed in to change notification settings - Fork 4
/
shadama3d.html
61 lines (55 loc) · 2.32 KB
/
shadama3d.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Shadama 3D</title>
<link rel="stylesheet" type="text/css" href="shadama.css">
<link rel="stylesheet" type="text/css" href="codemirror/codemirror.css">
<script src="codemirror/codemirror.js"></script>
<script src="codemirror/clike.js"></script>
<script src="thirdparty/ohm.min.js"></script>
<script src="thirdparty/papaparse.min.js"></script>
<script src="thirdparty/three.min.js"></script>
<script src="shadama-tests.js" type="text/javascript"></script>
<script src="https://unpkg.com/@croquet/[email protected]"></script>
<script type="module">
import {ShadamaFactory} from "./shadama.js";
let material, geometry, cube, renderer, scene, camera, canvas;
let shadama;
window.onload = () => {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 75, 512/512, 0.1, 1000 );
canvas = document.getElementById("shadamaCanvas");
renderer = new THREE.WebGLRenderer({webgl2: true, preserveDrawingBuffer: true, canvas: canvas});
renderer.setSize( 512, 512 );
//document.body.appendChild( renderer.domElement );
geometry = new THREE.BoxBufferGeometry( 512, 512, 512 );
material = new THREE.MeshBasicMaterial({color: 0x00004000, wireframe: true});
cube = new THREE.Mesh( geometry, material );
scene.add( cube );
camera.position.z = 500;
camera.position.x = 0;
camera.position.y = 0;
shadama = ShadamaFactory({renderer: renderer, dataPath: "./"}, 3, cube, "26-Airports.shadama", true);
shadama.maybeRunner(function() {shadama.handleEvents(scene, camera); renderer.render (scene, camera)});
};
</script>
</head>
<body>
<h1 id="bigTitle">Shadama</h1>
<div id="canvasHolder" style="float: left">
<canvas id="shadamaCanvas"></canvas>
</div>
<textarea style="float: left" id="code"></textarea>
<div style="float: left" id="controlBox">
<select id="myDropdown" class="dropdown-content"></select>
<hr>
<div id="watcherList"></div>
<hr>
<div id="envList"></div>
</div>
<br>
<div style="clear: left" id="readout"></div>
<button id="fullScreenButton">Full Screen</button>
<!-- <canvas id="debugCanvas1"></canvas> -->
</body>
</html>