-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
107 lines (96 loc) · 5.77 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Drifter - a Space Exploration VR experiment</title>
<!-- Note: following files contain Noctis IV code ported to JavaScript, and are licensed under the WTOF public license: http://anywherebb.com/wpl/wtof_public_license.html -->
<script src="niv_globals.js"></script>
<script src="niv_starmap.js"></script>
<script src="niv_drawingSpace.js"></script>
<script src="niv_drawingSurface.js"></script>
<script src="niv_engine.js"></script>
<script src="niv_space.js"></script>
<script src="niv_rand.js"></script>
<script src="niv_textures.js"></script>
<!-- End of Noctis IV code -->
</head>
<body>
<div style="position: absolute; top: 0px; z-index: 9999; right: 0px;">
<button onclick="switchScene()">Switch between surface and stardrifter</button>
<form id="searchStarForm">
<input id="searchStarInput" placeholder="Search star...">
</form>
</div>
<a-scene stats id="scene" vr-mode-ui="enabled: true" global-controller-actions>
<a-assets>
<script id="planet_surface" type="text/html">
<a-entity planet-fog>
<a-entity id="planet_geometry" planetsurfacegridmaker></a-entity>
<a-entity follow-camera>
<a-entity id="sky" geometry="primitive: sphere; radius: 1000;" planet-sky material="shader: sky; side: back"></a-entity>
<a-entity position="0 0 -3" hide ncc-model="filename: assets/noctis/mammal.ncc"></a-entity>
</a-entity>
<a-entity>
<a-entity light="type: ambient; color: #BBB"></a-entity>
<a-entity light="type: directional; color: #FFF; intensity: 0.6" position="-0.5 1 1"></a-entity>
</a-entity>
<a-entity movement-controls="speed: 0.2" id="camera-rig">
<a-camera wasd-controls-enabled="false" collider-check="targetElement: #planet_geometry"></a-camera>
<a-plane width="0.1" height="0.1" rotation="-90 0 0" position="0 0 0" debug-show-always></a-plane>
<a-entity hand-controller-actions>
<a-entity hand-controls="left" remove-hand-controls>
<a-sphere hand-tool="hand: left; name: first" radius="0.1" position="0 0 0" rotation="0 60 80" planet-space-material></a-sphere>
</a-entity>
<a-entity hand-controls="right" remove-hand-controls>
<a-entity hand-tool="hand: right; name: first" rotation="0 60 80" material="color: cyan; roughness: 1; metalness: 1;" geometry="primitive: planetsurface; xmin: 0; xmax: 199; ymin: 0; ymax: 199" scale="0.0015 0.0015 0.0015"></a-entity>
<a-entity hand-tool="hand: right; name: second" rotation="0 -20 0" geometry="primitive: plane" texture-material="src: txtr" scale="0.4 0.4 0.4"></a-entity>
<a-entity hand-tool="hand: right; name: third" rotation="0 -20 0" geometry="primitive: plane" texture-material="src: p_background; width: 360; height: 160; type: space" scale="0.36 0.16 0.4"></a-entity>
</a-entity>
</a-entity>
</a-entity>
</a-entity>
</script>
<script id="stardrifter" type="text/html">
<a-entity no-fog star-selected-actions>
<a-entity follow-camera>
<a-entity id="sky" geometry="primitive: sphere; radius: 1000;" material="shader: flat; color: black; side: back"></a-entity>
</a-entity>
<a-entity>
<a-light type="point" color="#ccf" position="-7.5 2.2 -9"></a-light>
<a-entity light="type: ambient; color: #225"></a-entity>
<a-entity position="0 1.3 0" ncc-model="scale:0.04; filename: assets/noctis/VEHICLE.NCC">
<a-entity show-star-details text="width: 2" position="-1 0 -9.5"></a-entity>
<a-entity show-guide-entries text="width: 2" position="1 0 -9.5"></a-entity>
</a-entity>
<a-entity position="0 1.3 0" id="starmap-parent">
<a-entity id="starmap" 3d-starmap></a-entity>
<a-sphere id="starmap-search-marker" star-marker debug-show-always color="#f00" radius="0.004">
<a-entity id="starmap-search-text" star-marker-text face-camera text="anchor: left; xOffset: 0.005; width: 0.3"></a-entity>
</a-sphere>
</a-entity>
</a-entity>
<a-entity movement-controls="speed: 0.2" id="camera-rig">
<a-camera wasd-controls-enabled="false"></a-camera>
<a-plane width="0.1" height="0.1" rotation="-90 0 0" position="0 0 0" debug-show-always></a-plane>
<a-entity hand-controller-actions>
<a-entity starmap-star-selector hand-controls="left" translate-with-grip="elementsToTranslate: #starmap-parent" remove-hand-controls hand-tool="hand: left; name: first">
<a-sphere debug-show-always color="#f00" radius="0.01"></a-sphere>
</a-entity>
<a-entity hand-controls="right" remove-hand-controls>
<a-entity hand-tool="hand: right; name: first">
<a-entity show-star-details rotation="0 0 90" text="width: 0.4"></a-entity>
</a-entity>
<a-entity hand-tool="hand: right; name: second">
<a-entity show-guide-entries rotation="0 0 90" text="width: 0.4"></a-entity>
</a-entity>
<a-sphere hand-tool="hand: right; name: third" color="#9f9" radius="0.01"></a-sphere>
</a-entity>
</a-entity>
</a-entity>
</a-entity>
</script>
</a-assets>
<a-entity id="selectedScene" template="src: #stardrifter"></a-entity>
</a-scene>
</body>
</html>