-
Notifications
You must be signed in to change notification settings - Fork 3
/
4.html
217 lines (173 loc) · 10.6 KB
/
4.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<!DOCTYPE html>
<html>
<head>
<title>Interactive Reading Environment in Web-Based Virtual Reality, ver. 1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
<script src="js/pdf.min.js"></script>
<script src="js/htmlembed.js"></script>
<!-- Word Vector -->
<script src="data/wordVector.js"></script>
<script src="js/word2vecutils.js"></script>
<!-- New Navigation -->
<script src="js/raycaster-extras.js"></script>
<script src="js/controller-listener.js"></script>
<script src="js/player-move.js"></script>
<!-- A-Frame GLTF Exporter -->
<script src="js/aframe-gltf-exporter.js"></script>
<script src="js/gltf-exporter-component.js"></script>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="intro4">
<div class="environment">
<div class="title">Please load a pdf file</div>
<div class="selectFrom">
<div id="my_pdf_viewer" style="text-align: center">
<input id="pdf-upload" type="file" style="margin-top: 40px;" />
<div id="canvas_container">
<canvas id="pdf_renderer" style="display:none;"></canvas>
</div>
</div>
</div>
</div>
</div>
<!-- Overlay for preloading and options -->
<!-- <div id="overlay" style="display: block; position: fixed; z-index: 2; background: black">
<div id="loader" style="color: white;">Loading material...</div>
</div> -->
<!--A-Frame Scene. Create navMesh, add Draco decoder -->
<a-scene gltf-model="dracoDecoderPath: decoder/" loading-screen="enabled: false">
<!-- Assets preload -->
<a-assets id="assets">
<a-asset-item id="3dEnvironment" src="3d/winter_loft.glb"></a-asset-item>
<a-asset-item id="monitor_vertical" src="3d/monitor_vertical.glb"></a-asset-item>
<a-asset-item id="monitor_horizontal" src="3d/monitor_horizontal.glb"></a-asset-item>
<img id="inImg" src="img/zoomIn.png">
<img id="outImg" src="img/zoomOut.png">
<img id="previousImg" src="img/left.png">
<img id="nextImg" src="img/right.png">
<img id="interfaceOn" src="img/interfaceOn.png">
<img id="interfaceOff" src="img/interfaceOff.png">
<img id="soundOn" src="img/soundOn.png">
<img id="soundOff" src="img/soundOff.png">
<img id="quiz" src="img/quiz.png">
<img id="notesOn" src="img/notesOn.png">
<img id="notesOff" src="img/notesOff.png">
<img id="export" src="img/export.png">
</a-assets>
<!--Hidden NavMesh-->
<!-- <a-entity id="nav-mesh" gltf-model="3d/navmesh.gltf" nav-mesh rotation="0 0 0" position="0 0 0" visible="false">
</a-entity> -->
<!-- Sound component -->
<a-entity id="soundlink" sound="" crossorigin="anonymous"></a-entity>
<!--3d Environment-->
<a-entity id="myEnvironment" gltf-model="#3dEnvironment" rotation="0 0 0" position="0 -2 0" scale="2 2 2">
</a-entity>
<a-plane class="groundPlane" scale="2 2 2" color="#333" width="8" height="8" rotation="-90 0 0" material=""
geometry="" position="0 0.01 0" visible="false"></a-plane>
<!-- Player -->
<a-entity id="player" position="0 0 0" player-move="controllerListenerId: #controller-data;
navigationMeshClass: groundPlane;">
<a-camera></a-camera>
<a-entity id="controller-data"
controller-listener="leftControllerId: #left-controller; rightControllerId: #right-controller;">
</a-entity>
<a-entity id="left-controller" oculus-touch-controls="hand: left">
</a-entity>
<!-- experiment with raycasting interval; slight performance improvement but jittery appearance in world -->
<a-entity id="right-controller" oculus-touch-controls="hand: right" laser-controls="hand: right"
raycaster="objects: .raycaster-target, .navButton, .groundPlane; interval: 0;"
raycaster-extras="controllerListenerId: #controller-data; beamImageSrc: #gradient; beamLength: 0.5;">
</a-entity>
</a-entity>
<!-- Click events for mouse/laser-controls -->
<a-entity position="0 0 0" cursor="fuse: false; rayOrigin: mouse;" raycaster="objects: .navButton">
</a-entity>
<a-entity id="mainWindow" position="0 1.11 -0.8" rotation="-10 0 0" raycaster-target="canGrab: true;"
geometry="primitive: plane; width: 0.8; height: 0.28"
material="color: #5475d4; transparent: true; opacity: 0.5; side:double" scale="1 1 1">
<!-- All buttons-->
<a-entity id="allButtons">
<a-entity id="zoom_in" class="navButton" geometry="primitive: plane;"
material="src: #inImg; transparent: true; opacity: 1; alpha-test: 0.5" scale="0.08 0.08 0.08"
position="-0.275 0.05 0.02"></a-entity>
<a-entity id="zoom_out" class="navButton" geometry="primitive: plane;"
material="src: #outImg; transparent: true; opacity: 1; alpha-test: 0.5" scale="0.08 0.08 0.08"
position="-0.175 0.05 0.02"></a-entity>
<a-entity id="go_previous" class="navButton" geometry="primitive: plane;"
material="src: #previousImg; transparent: true; opacity: 1; alpha-test: 0.5" scale="0.08 0.08 0.08"
position="-0.03 0.05 0.02"></a-entity>
<a-entity id="go_next" class="navButton" geometry="primitive: plane;"
material="src: #nextImg; transparent: true; opacity: 1; alpha-test: 0.5" scale="0.08 0.08 0.08"
position="0.07 0.05 0.02"></a-entity>
<a-entity id="current_page" geometry="primitive: plane; width: 0.18; height:0.08"
text="value: 0; color: #000; align: center; width: 1; height: 0.5"
material="transparent: true; opacity: 1; color: #fff" position="0.22 0.05 0.02"></a-entity>
<!-- Sound On/Off Button-->
<a-entity id="soundOnOff" class="navButton" geometry="primitive: plane;"
material="src: #soundOn; transparent: true; opacity: 1; alpha-test: 0.5" scale="0.08 0.08 0.08"
position="-0.175 -0.05 0.02"></a-entity>
<!-- Ask Question -->
<a-entity id="qa" class="navButton" geometry="primitive: plane;"
material="src: #quiz; transparent: true; opacity: 1; alpha-test: 0.5" scale="0.08 0.08 0.08"
position="-0.03 -0.05 0.02"></a-entity>
<!-- Notes On/Off-->
<a-entity id="notesOnOff" class="navButton" geometry="primitive: plane;"
material="src: #notesOff; transparent: true; opacity: 1; alpha-test: 0.5" scale="0.08 0.08 0.08"
position="0.07 -0.05 0.02"></a-entity>
<!-- Export Question -->
<a-entity id="exportModel" onclick="exportModel()" class="navButton" geometry="primitive: plane;"
material="src: #export; transparent: true; opacity: 1; alpha-test: 0.5" scale="0.08 0.08 0.08"
material="transparent: true; opacity: 1; alpha-test: 0.5" position="0.17 -0.05 0.02"></a-entity>
<!-- Left Answer's screen, which is hidden and will be printed upon request -->
<a-entity raycaster-target="canGrab: true;" position="-2.5 0.5 0"
rotation="0 45 7.5"
geometry="primitive: plane; width: 1; height: 1"
material="transparent: true; opacity: 0; alpha-test: 0.5">
<a-entity gltf-exporter id="infoWindow" width="4" height="4" side="double" transparent="false" visible="false" htmlembed>
<div class="notepad">
<div class="top">Notes</div>
<div id="printedQuestions" class="paper" contenteditable="true">
</div>
</div>
</a-entity>
</a-entity>
<!-- Right Screen -->
<a-entity id="tabletHorizontal" raycaster-target="canGrab: true;"
geometry="primitive: plane; width: 1; height: 1"
material="transparent: true; opacity: 0; alpha-test: 0.5" position="2.5 0.5 0" rotation="0 -45 -7.5" scale="0 0 0">
<a-entity gltf-model="#monitor_horizontal" position="0 -1.25 0" rotation="0 -180 0" scale="7 8.2 7">
</a-entity>
<!-- Game / Quiz generator -->
<a-entity id="quizWindow" position="0 -0.25 0.28" rotation="0 0 0" width="3" class="navButton"
htmlembed>
<div id="quizWrapper">
<div id="totalScore"></div>
<div id="remainingQuestions"></div>
<div id="question"></div>
</div>
</a-entity>
</a-entity>
</a-entity>
<!-- Interface On/Off Button -->
<a-entity id="openClose" class="navButton" geometry="primitive: plane;"
material="src: #interfaceOn; transparent: true; opacity: 1; alpha-test: 0.5" scale="0.05 0.05 0.05"
position="-0.36 -0.099 0.01"></a-entity>
<!-- Create parent plane so that book can be grabbed -->
<a-entity raycaster-target="canGrab: true;" position="0 0.5 -1"
geometry="primitive: plane; width: 1; height: 1" material="transparent: true; opacity: 0">
<!-- Pdf file display -->
<a-image id="book" src="" visible="false" side="double" transparent="false"></a-image>
</a-entity>
</a-entity>
<!-- Main Window -->
<!-- <a-entity id="" position="2.5 1.6 -1" rotation="0 -45 0"
geometry="primitive: plane; width: 2.5; height: 0.8;"
text="color: #000; align: center; width: 1.5; height: 1.5"
material="transparent: true; opacity: 1; side: double"></a-entity>
-->
</a-scene>
</body>
<script src="js/main_4.js"></script>
</html>