forked from rlamana/a-aviator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
193 lines (161 loc) · 7.38 KB
/
index.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A-Aviator: The Aviator using A-Frame</title>
<script src="https://aframe.io/releases/0.6.1/aframe.js"></script>
<!-- <script src="node_modules/aframe/dist/aframe-master.js"></script> -->
<script src="shadows.js"></script>
<script src="cockpit.js"></script>
<script src="propeller.js"></script>
<script src="clouds.js"></script>
<script src="hair.js"></script>
<script src="waves.js"></script>
<script src="plane-controller.js"></script>
</head>
<body style="background: linear-gradient(#e4e0ba, #f7d9aa);">
<a-scene fog="type: linear; color: #f7d9aa; near: 100; far: 950" shadows="true">
<a-assets>
<a-mixin id="cast-shadow" cast-shadow="cast: true; receive: true">
<a-mixin id="material-red" material="color: #f25346; flatShading: true"></a-mixin>
<a-mixin id="material-white" material="color: #d8d0d1; flatShading: true"></a-mixin>
<a-mixin id="material-brown" material="color: #59332e; flatShading: true"></a-mixin>
<a-mixin id="material-pink" material="color: #F5986E; flatShading: true"></a-mixin>
<a-mixin id="material-brown-dark" material="color: #23190f; flatShading: true"></a-mixin>
</a-assets>
<a-entity id="airplane" position="0 100 0" scale=".25 .25 .25" plane-controller>
<a-entity
id="cabin"
geometry="primitive: box; width: 80; height: 50; depth: 50; buffer: false"
position="0 0 0"
mixin="material-red cast-shadow"
cockpit="cool"></a-entity>
<a-entity id="engine"
geometry="primitive: box; width: 20; height: 50; depth: 50; buffer: false"
position="50 0 0"
mixin="material-white cast-shadow"></a-entity>
<a-entity id="tail"
geometry="primitive: box; width: 15; height: 20; depth: 5; buffer: false"
cast-shadow="cast: true; receive: true"
position="-40 20 0"
mixin="material-red"></a-entity>
<a-entity id="wing"
geometry="primitive: box; width: 30; height: 5; depth: 120; buffer: false"
position="0 15 0"
mixin="material-red cast-shadow"></a-entity>
<!-- Right Wheel -->
<a-entity id="wheel-r"
geometry="primitive: box; width: 30; height: 15; depth: 10; buffer: false"
position="25 -20 25"
mixin="material-red cast-shadow"></a-entity>
<a-entity id="tire-r"
geometry="primitive: box; width: 24; height: 24; depth: 4; buffer: false"
position="25 -28 25"
mixin="material-brown-dark cast-shadow">
<a-entity id="tire-axis-r"
geometry="primitive: box; width: 10; height: 10; depth: 6; buffer: false"
position="0 0 0"
mixin="material-brown cast-shadow"></a-entity>
</a-entity>
<!-- Left Wheel -->
<a-entity id="wheel-l"
geometry="primitive: box; width: 30; height: 15; depth: 10; buffer: false"
position="25 -20 -25"
mixin="material-red cast-shadow"></a-entity>
<a-entity id="tire-l"
geometry="primitive: box; width: 24; height: 24; depth: 4; buffer: false"
position="25 -28 -25"
mixin="material-brown-dark cast-shadow">
<a-entity id="tire-axis-l"
geometry="primitive: box; width: 10; height: 10; depth: 6; buffer: false"
position="0 0 0"
mixin="material-brown cast-shadow"></a-entity>
</a-entity>
<!-- Back Wheel -->
<a-entity id="tire-b"
geometry="primitive: box; width: 24; height: 24; depth: 4; buffer: false"
position="-35 -5 0"
scale=".5 .5 .5"
mixin="material-brown-dark cast-shadow">
<a-entity id="tire-axis-b"
geometry="primitive: box; width: 10; height: 10; depth: 6; buffer: false"
position="0 0 0"
mixin="material-brown cast-shadow"></a-entity>
</a-entity>
<a-entity id="suspension"
geometry="primitive: box; width: 4; height: 20; depth: 4; buffer: false"
position="-32 3 0"
rotation="0 0 -17"
mixin="material-red cast-shadow"></a-entity>
<a-entity id="propeller"
geometry="primitive: box; width: 20; height: 10; depth: 10; buffer: false"
position="60 0 0"
mixin="material-brown cast-shadow"
propeller>
<a-entity id="blade1"
geometry="primitive: box; width: 1; height: 80; depth: 15; buffer: false"
position="8 0 0"
mixin="material-brown-dark cast-shadow"></a-entity>
<a-entity id="blade2"
geometry="primitive: box; width: 1; height: 80; depth: 15; buffer: false"
position="8 0 0"
rotation="90 0 0"
mixin="material-brown-dark cast-shadow"></a-entity>
</a-entity>
<a-entity id="pilot" position="-10 27 0">
<a-entity id="body"
geometry="primitive: box; width: 15; height: 15; depth: 15"
position="2 -12 0"
mixin="material-brown cast-shadow"></a-entity>
<a-entity id="face"
geometry="primitive: box; width: 10; height: 10; depth: 10"
position="0 0 0"
mixin="material-pink"></a-entity>
<a-entity id="hair"
position="0 0 0"
mixin="material-brown"
hair>
</a-entity>
<a-entity id="glass-right"
geometry="primitive: box; width: 5; height: 5; depth: 5"
position="6 0 3"
mixin="material-brown"></a-entity>
<a-entity id="glass-left"
geometry="primitive: box; width: 5; height: 5; depth: 5"
position="6 0 -3"
mixin="material-brown"></a-entity>
<a-entity id="glass-a"
geometry="primitive: box; width: 11; height: 1; depth: 11"
position="0 0 0"
mixin="material-brown"></a-entity>
<a-entity id="ear-right"
geometry="primitive: box; width: 2; height: 3; depth: 2"
position="0 0 6"
mixin="material-brown"></a-entity>
<a-entity id="ear-left"
geometry="primitive: box; width: 2; height: 3; depth: 2"
position="0 0 -6"
mixin="material-pink"></a-entity>
</a-entity>
</a-entity>
<a-entity id="clouds"
material="color: white"
position="0 -600 0"
clouds>
</a-entity>
<a-entity id="sea"
geometry="primitive: cylinder; height: 800; radius: 600; segmentsRadial: 40; segmentsHeight: 10; buffer: false"
position="0 -600 0"
rotation="-90 0 0"
cast-shadow="receive: true"
material="color: #68c3c0; opacity: .8; transparent: true; flatShading: true"
waves></a-entity>
<a-entity position="50 100 200" rotation="0 6 0">
<a-entity camera="fov:50; far:10000; near:.1" look-controls></a-entity>
</a-entity>
<a-entity light="type: hemisphere; color: #aaaaaa; groundColor: #000000; intensity: 0.9" position="0 0 0"></a-entity>
<a-entity light="type: directional; color: #ffffff; intensity: 1.0" position="150 350 350" cast-shadow="cast: true"></a-entity>
<a-entity light="type: ambient; intensity: .7; color: #dc8874;"></a-entity>
</a-scene>
</body>
</html>