-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex-fastopt.html
92 lines (69 loc) · 2.44 KB
/
index-fastopt.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html>
<head>
<title>Babylon - Basic scene</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style>
html, body {
overflow: hidden;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#renderCanvas {
width: 100%;
height: 100%;
touch-action: none;
}
</style>
</head>
<body>
<div id="playground">
</div>
<canvas id="renderCanvas"></canvas>
<script type="text/javascript" src="./dist/babylon.2.2.max.js"></script>
<script type="text/javascript" src="./target/scala-2.11/babylonjs-facade-fastopt.js"></script>
<script type="text/javascript" src="./target/scala-2.11/babylonjs-facade-launcher.js"></script>
<!--
<script>
// This begins the creation of a function that we will 'call' just after it's built
var createScene = function () {
// Now create a basic Babylon Scene object
var scene = new BABYLON.Scene(engine);
// Change the scene background color to green.
scene.clearColor = new BABYLON.Color3(0, 1, 0);
// This creates and positions a free camera
var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);
// This targets the camera to scene origin
camera.setTarget(BABYLON.Vector3.Zero());
// This attaches the camera to the canvas
camera.attachControl(canvas, false);
// This creates a light, aiming 0,1,0 - to the sky.
var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
// Dim the light a small amount
light.intensity = .5;
// Let's try our built-in 'sphere' shape. Params: name, subdivisions, size, scene
var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene);
// Move the sphere upward 1/2 its height
sphere.position.y = 1;
// Let's try our built-in 'ground' shape. Params: name, width, depth, subdivisions, scene
var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);
// Leave this function
return scene;
}; // End of createScene function
// Get the canvas element from our HTML above
var canvas = document.getElementById("renderCanvas");
// Load the BABYLON 3D engine
var engine = new BABYLON.Engine(canvas, true);
// Now, call the createScene function that you just finished creating
var scene = createScene();
// Register a render loop to repeatedly render the scene
// Watch for browser/canvas resize events
window.addEventListener("resize", function () {
engine.resize();
});
</script>
-->
</body>
</html>