-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
103 lines (86 loc) · 3.31 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Assignment: Virtual House</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Alegreya Sans SC' rel='stylesheet'>
<script src="js/lib/three.min.js"></script>
<script src="js/lib/dat.gui.min.js"></script>
<script src="js/controls/OrbitControls.js"></script>
<script src="js/controls/DragControls.js"></script>
<script src="js/loaders/OBJLoader.js"></script>
<script src="js/loaders/MTLLoader.js"></script>
<script src="js/loaders/PLYLoader.js"></script>
<script src="js/classes/ApertureLibrary.js"></script>
<script src="js/classes/ApertureModel.js"></script>
<script src="js/classes/Environment.js"></script>
<script src="js/classes/Floor.js"></script>
<script src="js/classes/House.js"></script>
<script src="js/classes/HouseLightManager.js"></script>
<script src="js/classes/MaterialLibrary.js"></script>
<script src="js/classes/ModelLibrary.js"></script>
<script src="js/classes/Opening.js"></script>
<script src="js/classes/Room.js"></script>
<script src="js/classes/Wall.js"></script>
</head>
<body>
<div id="lightPanel">
<h3 style="color: #fff;">House Lighting</h3>
<ul id="lightPanelList">
<li>
<div class="button" onclick="houseLighting.lightsOn(0)">Turn All Lights on</div>
</li>
<li>
<div class="button" onclick="houseLighting.lightsOff(0)">Turn All Lights off</div>
</li>
</ul>
<h3 style="color: #fff;">Expensive renderings</h3>
<ul>
<li>
<div class="button" onclick="addTrees()">Grow Trees</div>
</li>
<li>
<div class="button" onclick="loadFurniture()">Load Furniture</div>
</li>
</ul>
</div>
<div id="group-info">
<h2 style="color: #fff;">Virtual House</h2>
<ul>
<li>Group 1 members:</li>
<li>Roald Braathen: 12624829 |</li>
<li>Thien Nguyen: 12783837 |</li>
<li>Omer Serhat Dai: 13111733 |</li>
<li>Rohit Nair: 12912426 |</li>
</ul>
</div>
<script type="x-shader/x-vertex" id="vertexShader">
varying vec3 vWorldPosition;
void main() {
vec4 worldPosition = modelMatrix * vec4( position, 1.0 );
vWorldPosition = worldPosition.xyz;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
</script>
<script type="x-shader/x-fragment" id="fragmentShader">
uniform vec3 topColor;
uniform vec3 bottomColor;
uniform float offset;
uniform float exponent;
varying vec3 vWorldPosition;
void main() {
float h = normalize( vWorldPosition + offset ).y;
gl_FragColor = vec4( mix( bottomColor, topColor, max( pow( max( h , 0.0), exponent ), 0.0 ) ), 1.0 );
}
</script>
<script src="js/main.js" type="text/javascript"></script>
<script src="js/tree.js" type="text/javascript"></script>
<script src="js/furniture.js" type="text/javascript"></script>
<script>
for (var z = 0; z < houseLighting.sceneLights.length; z += 2) {
document.getElementById("lightPanelList").innerHTML += '<li><div class="button" onclick="houseLighting.lightToggle(' + z + ')">' + houseLighting.sceneLights[z + 1] + '</div></li>';
}
</script>
</body>
</html>