awacke1 commited on
Commit
973c844
·
1 Parent(s): b330415

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +61 -16
index.html CHANGED
@@ -1,19 +1,64 @@
1
  <!DOCTYPE html>
2
  <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
  <!DOCTYPE html>
2
  <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Babylon.js Game Example</title>
6
+ <script src="https://cdn.babylonjs.com/babylon.js"></script>
7
+ <script src="https://cdn.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
8
+ <style>
9
+ canvas {
10
+ width: 100%;
11
+ height: 100%;
12
+ touch-action: none;
13
+ }
14
+ </style>
15
+ </head>
16
+ <body>
17
+ <canvas id="renderCanvas"></canvas>
18
+ <script>
19
+ window.addEventListener('DOMContentLoaded', function () {
20
+ var canvas = document.getElementById('renderCanvas');
21
+ var engine = new BABYLON.Engine(canvas, true);
22
+
23
+ var createScene = function () {
24
+ var scene = new BABYLON.Scene(engine);
25
+
26
+ // Create a camera
27
+ var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 10, BABYLON.Vector3.Zero(), scene);
28
+
29
+ // Create a light
30
+ var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
31
+
32
+ // Create a sphere
33
+ var sphere = BABYLON.MeshBuilder.CreateSphere("sphere", {diameter: 2}, scene);
34
+
35
+ // Add some texture to the sphere
36
+ var material = new BABYLON.StandardMaterial("texture", scene);
37
+ material.diffuseTexture = new BABYLON.Texture("https://www.babylonjs-playground.com/textures/grass.jpg", scene);
38
+ sphere.material = material;
39
+
40
+ // Animate the sphere
41
+ var animation = new BABYLON.Animation("myAnimation", "position.x", 30, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
42
+ var keys = [];
43
+ keys.push({frame: 0, value: 0});
44
+ keys.push({frame: 100, value: 10});
45
+ animation.setKeys(keys);
46
+ sphere.animations.push(animation);
47
+ scene.beginAnimation(sphere, 0, 100, true);
48
+
49
+ return scene;
50
+ }
51
+
52
+ var scene = createScene();
53
+
54
+ engine.runRenderLoop(function () {
55
+ scene.render();
56
+ });
57
+
58
+ window.addEventListener('resize', function () {
59
+ engine.resize();
60
+ });
61
+ });
62
+ </script>
63
+ </body>
64
  </html>