awacke1 commited on
Commit
1fb1246
·
1 Parent(s): 4930bb3

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +64 -36
index.html CHANGED
@@ -9,46 +9,74 @@
9
  <body>
10
  <a-scene>
11
  <a-assets>
12
- <img id="skyTexture" src="https://cdn.aframe.io/a-painter/images/sky.jpg">
 
13
  <img id="aircraftTexture" src="https://cdn.aframe.io/a-painter/images/brushes/fur.jpg">
14
  </a-assets>
15
- <a-sky material="shader: flat; src: #skyTexture"></a-sky>
16
- <a-entity noise="speed: 0.5; scale: 10 10 10; amplitude: 5; octaves: 5;" geometry="primitive: plane; height: 100; width: 100;" material="shader: standard; src: https://cdn.aframe.io/a-painter/images/terrain.jpg; roughness: 1;"></a-entity>
17
- <a-entity id="aircraft" position="0 2 -5" rotation="0 0 0" geometry="primitive: box; height: 0.5; width: 1.5; depth: 2" material="src: #aircraftTexture" shadow="cast: true; receive: false;"></a-entity>
18
- <a-light type="directional" color="#ffffff" intensity="0.5" position="0 10 -10" shadow="cast: true; receive: true;"></a-light>
19
- <a-camera>
20
- <a-cursor></a-cursor>
21
- </a-camera>
22
- </a-scene>
23
- <script>
24
- var aircraft = document.querySelector('#aircraft');
25
- var velocity = new THREE.Vector3(0, 0, 0);
26
- var gravity = new THREE.Vector3(0, -0.1, 0);
27
- var thrust = new THREE.Vector3(0, 0, -0.1);
28
- var keys = {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
- function update() {
31
- if (keys['ArrowUp']) {
32
- velocity.add(thrust);
33
- }
34
- velocity.add(gravity);
35
- aircraft.object3D.position.add(velocity);
36
- aircraft.object3D.rotation.x = velocity.z * 0.1;
37
- aircraft.object3D.rotation.y = -velocity.x * 0.1;
38
- aircraft.object3D.rotation.z = -velocity.y * 0.1;
39
- requestAnimationFrame(update);
40
- }
41
 
42
- window.addEventListener('keydown', function(event) {
43
- keys[event.code] = true;
44
- });
45
 
46
- window.addEventListener('keyup', function(event) {
47
- keys[event.code] = false;
48
- });
49
 
50
- update();
51
- </script>
52
- </body>
53
- </html>
54
 
 
 
 
 
9
  <body>
10
  <a-scene>
11
  <a-assets>
12
+ <img id="skyTexture" src="https://i.imgur.com/BhMPg1d.jpg">
13
+ <img id="starTexture" src="https://i.imgur.com/tpGKfVn.png">
14
  <img id="aircraftTexture" src="https://cdn.aframe.io/a-painter/images/brushes/fur.jpg">
15
  </a-assets>
16
+ <a-entity noise="speed: 0.5; scale: 10 10 10; amplitude: 5; octaves: 5;" geometry="primitive: plane; height: 100; width: 100;" material="shader: standard; src: #skyTexture; roughness: 1;"></a-entity>
17
+ <a-entity position="0 20 -100">
18
+ <a-entity light="type: ambient; color: #3a3a3a;"></a-entity>
19
+ <a-entity light="type: point; color: #fff; intensity: 1; distance: 50;">
20
+ <a-sphere radius="1" position="0 0 0" material="src: #starTexture; transparent: true; opacity: 0.9;"></a-sphere>
21
+ </a-entity>
22
+ <a-entity light="type: point; color: #fff; intensity: 1; distance: 200;">
23
+ <a-sphere radius="1" position="50 -20 -100" material="src: #starTexture; transparent: true; opacity: 0.9;"></a-sphere>
24
+ </a-entity>
25
+ <a-entity light="type: point; color: #fff; intensity: 1; distance: 150;">
26
+ <a-sphere radius="1" position="-100 20 -50" material="src: #starTexture; transparent: true; opacity: 0.9;"></a-sphere>
27
+ </a-entity>
28
+ <a-entity light="type: point; color: #fff; intensity: 1; distance: 100;">
29
+ <a-sphere radius="1" position="30 -50 -80" material="src: #starTexture; transparent: true; opacity: 0.9;"></a-sphere>
30
+ </a-entity>
31
+ <a-entity light="type: point; color: #fff; intensity: 1; distance: 50;">
32
+ <a-sphere radius="1" position="-80 -10 -150" material="src: #starTexture; transparent: true; opacity: 0.9;"></a-sphere>
33
+ </a-entity>
34
+ <a-entity fog="type: exponential; color: #8cc7d9; density: 0.02;"></a-entity>
35
+ </a-entity>
36
+ <a-entity id="aircraft" position="0 2 -5" rotation="0 0 0" geometry="primitive: box; height: 0.5; width: 1.5; depth: 2" material="src: #aircraftTexture" shadow="cast: true
37
+ ; receive: false;"></a-entity>
38
+ <a-entity position="0 0 -10">
39
+ <a-entity light="type: point; color: #fff; intensity: 5; distance: 20;"></a-entity>
40
+ <a-entity particle-system="color: #fff; particleCount: 5000; maxAge: 3; velocitySpread: 2 2 2; accelerationValue: 0 -1 0;"></a-entity>
41
+ <a-entity light="type: point; color: #fff; intensity: 0.5; distance: 50;" position="0 -5 -20">
42
+ <a-entity geometry="primitive: sphere; radius: 1;" material="emissive: #fff; emissiveIntensity: 1;"></a-entity>
43
+ </a-entity>
44
+ </a-entity>
45
+ <a-camera>
46
+ <a-cursor></a-cursor>
47
+ </a-camera>
48
+ <a-entity volume-light="density: 0.25; color: #8cc7d9;"></a-entity>
49
+ </a-scene>
50
+ <script>
51
+ var aircraft = document.querySelector('#aircraft');
52
+ var velocity = new THREE.Vector3(0, 0, 0);
53
+ var gravity = new THREE.Vector3(0, -0.1, 0);
54
+ var thrust = new THREE.Vector3(0, 0, -0.1);
55
+ var keys = {};
56
 
57
+ function update() {
58
+ if (keys['ArrowUp']) {
59
+ velocity.add(thrust);
60
+ }
61
+ velocity.add(gravity);
62
+ aircraft.object3D.position.add(velocity);
63
+ aircraft.object3D.rotation.x = velocity.z * 0.1;
64
+ aircraft.object3D.rotation.y = -velocity.x * 0.1;
65
+ aircraft.object3D.rotation.z = -velocity.y * 0.1;
66
+ requestAnimationFrame(update);
67
+ }
68
 
69
+ window.addEventListener('keydown', function(event) {
70
+ keys[event.code] = true;
71
+ });
72
 
73
+ window.addEventListener('keyup', function(event) {
74
+ keys[event.code] = false;
75
+ });
76
 
77
+ update();
78
+ </script>
 
 
79
 
80
+
81
+ </body>
82
+ </html>