-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
164 lines (148 loc) · 7.26 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
<!DOCTYPE html>
<html>
<head>
<script src="lib/jquery-3.5.1.js"></script>
<script src="parallel.js"></script>
<script src="webgl-debug.js"></script>
<link rel='stylesheet' href='css/style.css'>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript" src="model.js"></script>
<script type="text/javascript" src="handler.js"></script>
<script type="text/javascript" src="help.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript" src="collision.js"></script>
<script src="https://kit.fontawesome.com/7e8e0cf498.js" crossorigin="anonymous"></script>
</head>
<body onLoad="main();">
<div class="nav-bar">
<div class="largefont"><p>FPS</p>
<div>target <span id="fps">--</span></div>
<br>
<div>current <span id="display_fps">--</span></div>
</div>
<div class="pane-nav">
<div class="accordion">
<div class="size">
<div class="upside-menu"><i class="fas fa-arrow-left" style="position:left"></i> <i class="fas fa-times-circle" style="position:right"></i></div>
<ul class="list run-animation">
</ul>
</div>
<a href="#" class="field" name="rooms"><i class="fas fa-cube"></i></a>
<br>
<a href="#" class="field" name="furniture"><i class="fas fa-couch"></i></i></a>
<br>
<a href="#" class="field" name="description"><i class="fas fa-info-circle"></i></i></a>
</div>
</div>
<a id="general-info" href="#" class="top-view" style="position: bottom">general info</a>
<a href="#" class="top-view" onClick="topView();">set top view</a>
<a href="#" class="top-view" onClick="resetView();">reset view</a>
<a id="disable-collision" href="#" class="top-view" onClick="disableCollision();">disable collision</a>
</div>
</div>
<div class="homepage">
<canvas id="my-canvas" class="my-canvas" width=1600; height=900 style="background-color:#e7f9ff"> No Canvas Element support on your browser! </canvas>
</div>
<span class="open light-icon"><i class="fas fa-lightbulb"></i></span>
<div class="options-menu run-animation" id="lights-menu">
<span id="close"><i class="fa fa-times" aria-hidden="true"></i>
</span>
<td style="background-color: white; font-family: courier; padding: 5px;">
<div id="options">
<p><b> Light Source </b></p>
<form>
<input type="radio" name="light" id="yesl" onchange="updateLightType(this.value);" value="1" checked> Directional <br/>
<input type="radio" name="light" onchange="updateLightType(this.value);" value="2" > Point <br/>
<input type="radio" name="light" onchange="updateLightType(this.value);" value="3" > Point (with decay)<br/>
<input type="radio" name="light" onchange="updateLightType(this.value);" value="4" > Spot <br/>
<input type="radio" name="light" id="nol" onchange="updateLightType(this.value);" value="5" > [NO Light] <br/>
</form>
<p><b> Texture Influence </b></p>
<div id="slider1"> 0
<input id="slide1" type="range" min="0" max="1" step="0.05" value="1" onchange="updateTextureInfluence(this.value);"/> 1 <br/>
</div>
<p><b> Ambient Light Influence </b></p>
<div id="slider1"> 0
<input id="slide2" type="range" min="0" max="1" step="0.1" value="0.1" onchange="updateAmbientLightInfluence(this.value);"/> 1 <br/>
<p><b> Ambient Light Color </b></p>
<p align="center">
<input id="colorPicker" type="color" value="#FFFFFF" onchange="updateAmbientLightColor(this.value);"/>
</p> </div>
<p><b> Emission Influence </b></p>
<div id="slider1"> 0
<input id="slide2" type="range" min="0" max="1" step="0.1" value="0.1" onchange="updateEmitInfluence(this.value);"/> 1 <br/>
</div>
</td>
</div>
</div>
<div id="legend" class="legend">
<span id="close-legend"><i class="fa fa-times" aria-hidden="true"></i></span>
<h3> Useful instructions: </h3>
<ul>
<li>First choose your room planimetry style by clicking on the cube icon on the left(once you have selected a room, to change room style you need to refresh the webpage);</li>
<li>You can import some furniture models using the sofa icon on the left;</li>
<li>In the top right corner you can use the light bulb to manage lighting.</li>
<li>Use mouse wheel to zoom-in and out in the 3D view, and left-mouse clicked + mouse move to move the camera view.
<li> You can also import only furniture to visualize it.</li>
<li>Double click on a furniture object and then <b>canc</b> to remove it from the view.</li>
<li>When you want to move an object double click on it, a sound will be reproduced.</li>
</ul>
<h3>Commands for moving furniture:</h3>
<div class="svg">
<div class="svg-1"><img class="svg-img" src="img/keyboard/global.svg"></div>
<div class="svg-2">
<p>Use <b>w</b> and <b>s</b> to move along z axis.</p>
<p>Use <b>a</b> and <b>d</b> to move along x axis.</p>
<hr>
<p>Use <b>z</b> and <b>x</b> to scale the object.</p>
<hr>
<p>Use <b>q</b> and <b>e</b> to rotate the object along y axis.</p>
<hr>
<p>Use <b>u</b> and <b>i</b> to move along y axis.</p>
</div>
</div>
</div>
<script id="vertex-shader-3d" type="x-shader/x-vertex">
attribute vec4 a_position;
varying vec4 v_position;
void main() {
v_position = a_position;
gl_Position = a_position;
gl_Position.z = 1.0;
}
</script>
<!-- fragment shader -->
<script id="fragment-shader-3d" type="x-shader/x-fragment">
precision mediump float;
uniform samplerCube u_skybox;
uniform mat4 u_viewDirectionProjectionInverse;
varying vec4 v_position;
void main() {
vec4 t = u_viewDirectionProjectionInverse * v_position;
gl_FragColor = textureCube(u_skybox, normalize(t.xyz / t.w));
}
</script>
<script>
var lightsMenu = document.getElementById("lights-menu");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("open")[0];
span.onclick = function() {
lightsMenu.style.display = "block";
}
close = document.getElementById("close");
close.onclick = function() {
lightsMenu.style.display = "none";
}
var buttonInfo = document.getElementById("general-info");
var legend = document.getElementById("legend");
var closeLegend = document.getElementById("close-legend");
buttonInfo.onclick = function() {
legend.style.display = "block";
}
closeLegend.onclick = function() {
legend.style.display = "none";
}
</script>
</body>
</html>