-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·159 lines (130 loc) · 5.14 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>OdinVR</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, shrink-to-fit=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta class="top-bar" name="theme-color" content="#D81B60" />
<meta class="top-bar" name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />
</head>
<body>
<div id="particles-js"></div>
<div id="content-container">
<h1 style="text-align: center">Welcome to OdinVR!</h1>
<h3 style="text-align: center">Please enter your room code to join the presentation.</h3>
<p style="text-align: center"><input type="text" id="numField" maxlength="7"></input></p>
<h2 style="text-align: center"><a href="#" data-wipe="Join" onclick="joinRoom();">Join</a></h2>
</div>
</body>
<script>
/*
* Debug parameters.
*/
WebVRConfig = {
/**
* webvr-polyfill configuration
*/
// Forces availability of VR mode.
//FORCE_ENABLE_VR: true, // Default: false.
// Complementary filter coefficient. 0 for accelerometer, 1 for gyro.
//K_FILTER: 0.98, // Default: 0.98.
// How far into the future to predict during fast motion.
//PREDICTION_TIME_S: 0.040, // Default: 0.040 (in seconds).
// Flag to disable touch panner. In case you have your own touch controls
//TOUCH_PANNER_DISABLED: true, // Default: false.
// Enable yaw panning only, disabling roll and pitch. This can be useful for
// panoramas with nothing interesting above or below.
//YAW_ONLY: true, // Default: false.
// Enable the deprecated version of the API (navigator.getVRDevices).
//ENABLE_DEPRECATED_API: true, // Default: false.
// Scales the recommended buffer size reported by WebVR, which can improve
// performance. Making this very small can lower the effective resolution of
// your scene.
BUFFER_SCALE: 0.5, // default: 1.0
// Allow VRDisplay.submitFrame to change gl bindings, which is more
// efficient if the application code will re-bind it's resources on the
// next frame anyway.
// Dirty bindings include: gl.FRAMEBUFFER_BINDING, gl.CURRENT_PROGRAM,
// gl.ARRAY_BUFFER_BINDING, gl.ELEMENT_ARRAY_BUFFER_BINDING,
// and gl.TEXTURE_BINDING_2D for texture unit 0
// Warning: enabling this might lead to rendering issues.
//DIRTY_SUBMIT_FRAME_BINDINGS: true // default: false
};
</script>
<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script>
<!-- <script src="http://localhost:6606/socket.io/socket.io.js"></script> -->
<!--
A polyfill for Promises. Needed for IE and Edge.
-->
<script src="node_modules/es6-promise/dist/es6-promise.js"></script>
<!--
three.js 3d library
-->
<script src="node_modules/three/build/three.min.js"></script>
<!--
VRControls.js acquires positional information from connected VR devices and applies the transformations to a three.js camera object.
-->
<script src="node_modules/three/examples/js/controls/VRControls.js"></script>
<!--
VREffect.js handles stereo camera setup and rendering.
-->
<script src="node_modules/three/examples/js/effects/VREffect.js"></script>
<!--
A polyfill for WebVR using the Device{Motion,Orientation}Event API.
-->
<script src="node_modules/webvr-polyfill/build/webvr-polyfill.js"></script>
<!--
Helps enter and exit VR mode, provides best practices while in VR.
-->
<script src="build/webvr-manager.js"></script>
<script src="node_modules/three/examples/js/loaders/ColladaLoader.js"></script>
<script src="reticulum.js"></script>
<script src="rendering.js"></script>
<script src="scenebuilder.js"></script>
<script src="remote.js"></script>
<script src="scene.js"></script>
<script src="interaction.js"></script>
<script src="particles.js"></script>
<script>
$(function() {
$('body').css('background-color', '#D81B60');
$('#numField').css('background-color', '#AD1457');
$('#particles-js').css('opacity', 1);
particlesJS.load('particles-js', 'particles.json', function() {
console.log('callback - particles.js config loaded');
});
});
function joinRoom() {
var numText = $("#numField").val();
console.log("numField val",$("#numField").val(),numText);
if(numText === "") {
var sceneJSON = {
models: [{path: "edb61b2b6dfc7e2d2e11e87f9bf41b71", posx: 0, posy: 0, posz: 0, scale: 3, rotx: 0, roty: 0, rotz: 0, spin: true, spinaxis: 'X'}],
skybox: "grid",
skyboxSize: "50",
skyboxPos: "25",
cameraHeight: 1.5,
};
if(viewPlaced == false) {
renderInBody();
viewPlaced = true;
}
receiveSceneData(sceneJSON);
return;
}
connectToRoom(numText,function(){
$('body').load('lobby.html');
$('body').css('background-color', '#F5F5F5');
$('.top-bar').attr('content', '#3F51B5');
});
}
</script>
</html>