forked from Gekk0r/Buonconsiglio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
229 lines (184 loc) · 8.48 KB
/
index2.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
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Buonconsiglio</title>
<link rel="stylesheet" type="text/css" href="Castle/build/potree/potree.css">
<link rel="stylesheet" type="text/css" href="Castle/libs/jquery-ui-1.11.4/jquery-ui.css">
<link rel="stylesheet" href="Castle/libs/openlayers3/ol.css" type="text/css">
</head>
<body>
<script src="Castle/libs/jquery-2.1.4/jquery-2.1.4.min.js"></script>
<script src="Castle/libs/jquery-ui-1.11.4/jquery-ui.min.js"></script>
<script src="Castle/libs/three.js/build/three.js"></script>
<script src="Castle/libs/other/stats.min.js"></script>
<script src="Castle/libs/other/BinaryHeap.js"></script>
<script src="Castle/libs/tween/tween.min.js"></script>
<script src="Castle/libs/d3/d3.js"></script>
<script src="Castle/libs/proj4/proj4.js"></script>
<script src="Castle/libs/openlayers3/ol.js"></script>
<script src="Castle/build/potree/potree.js"></script>
<script src="Castle/raycast.js"></script>
<!-- uncomment this to debug individual js files -->
<!--
<script src="../src/viewer/viewer.js"></script>
<script src="../src/viewer/profile.js"></script>
<script src="../src/viewer/ProgressBar.js"></script>
<script src="../src/viewer/map.js"></script>
<script src="../src/PointCloudOctree.js"></script>
<script src="../src/PointCloudOctreeGeometry.js"></script>
<script src="../src/loader/POCLoader.js"></script>
<script src="../src/loader/BinaryLoader.js"></script>
<script src="../src/loader/LasLazLoader.js"></script>
<script src="../src/materials/PointCloudMaterial.js"></script>
<script src="../src/materials/EyeDomeLightingMaterial.js"></script>
<script src="../src/EarthControls.js"></script>
<script src="../src/OrbitControls.js"></script>
<script src="../src/FirstPersonControls.js"></script>
<script src="../src/GeoControls.js"></script>
<script src="../src/utils/ProfileTool.js"></script>
<script src="../src/utils/MeasuringTool.js"></script>
<script src="../src/utils/TransformationTool.js"></script>
<script src="../src/utils/VolumeTool.js"></script>
<script src="../src/utils.js"></script>
<script src="../src/LRU.js"></script>
<script src="../src/Annotation.js"></script>
<script src="../src/TextSprite.js"></script>
<script src="../src/Features.js"></script>
<script src="../src/extensions/PerspectiveCamera.js"></script>
<script src="../src/arena4d/PointCloudArena4D.js"></script>
<script src="../src/arena4d/PointCloudArena4DGeometry.js"></script>
-->
<!-- INCLUDE ADDITIONAL DEPENDENCIES HERE -->
<!-- INCLUDE SETTINGS HERE -->
<!--
<script src="../libs/plasio/js/laslaz.js"></script>
<script src="../libs/plasio/vendor/bluebird.js"></script>
<script src="../build/potree/laslaz.js"></script>
-->
<div class="potree_container" style="position: absolute; width: 100%; height: 100%; left: 0px; top: 0px; ">
<div id="potree_render_area">
<img class="potree_menu_toggle" src="Castle/resources/icons/menu_button.svg" onclick="viewer.toggleSidebar()" />
<img id="potree_map_toggle" src="Castle/resources/icons/map_icon.png" onclick="viewer.toggleMap()" style="display: none"/>
<div id="potree_map" class="mapBox" style="position: absolute; left: 50px; top: 50px; width: 400px; height: 400px; display: none">
<div id="potree_map_header" style="position: absolute; width: 100%; height: 25px; top: 0px; background-color: rgba(0,0,0,0.5); z-index: 1000; border-top-left-radius: 3px; border-top-right-radius: 3px;">
</div>
<div id="potree_map_content" class="map" style="position: absolute; z-index: 100; top: 25px; width: 100%; height: calc(100% - 25px); border: 2px solid rgba(0,0,0,0.5); box-sizing: border-box;"></div>
</div>
<!-- HEADING -->
<div id="potree_description" class="potree_info_text"></div>
</div>
<div id="potree_sidebar_container"> </div>
</div>
<script>
// Hash table(Link:Label)
var pointcloudMapping = {
"Castle/resources/pointclouds/castle/cloud.js": "Aerial Castle",
"Castle/resources/pointclouds/castleEast/cloud.js": "Aerial Castle East",
"Castle/resources/pointclouds/castleWest/cloud.js": "Aerial Castle West",
"Castle/resources/pointclouds/walls_outside/cloud.js": "Walls",
"Castle/resources/pointclouds/door/cloud.js": "Door",
"Castle/resources/pointclouds/door2/cloud.js": "Door 2"
}
var onPointCloudLoaded = function(event){
var x = 1;
// do stuff here that should be executed whenever a point cloud has been loaded.
// event.pointcloud returns the point cloud object
x++;
console.log("a point cloud has been loaded" + x);
};
viewer = new Potree.Viewer(document.getElementById("potree_render_area"), {
"onPointCloudLoaded": onPointCloudLoaded
});
viewer.setEDLEnabled(false);
viewer.setPointSize(3);
viewer.setMaterial("RGB");
viewer.setFOV(60);
viewer.setPointSizing("Fixed");
viewer.setQuality("Squares");
viewer.setPointBudget(1*1000*1000);
//viewer.setOpacity(0.03);
//viewer.setMinNodeSize(100);
viewer.setShowSkybox(true);
// viewer.setDescription("Potree 1.4RC. Use this for testing purposes only! Check <a href='https://twitter.com/m_schuetz' target='_blank'>here</a> for new updates.<br>"
// + "Report issues on the <a href='https://github.com/potree/potree' target='_blank'>github repository</a> or <a href='mailto:[email protected]' target='_blank'>[email protected]</a><br>"
//);
for (url in pointcloudMapping) {
viewer.addPointCloud(pointcloudMapping[url], function(res){
// res.pointcloud.name;
});
}
viewer.loadGUI();
var materialImg1 = THREE.ImageUtils.loadTexture('Castle/img/castle_ground.png');
var img1 = new THREE.MeshBasicMaterial({ map: materialImg1, transparent:true });
//img.map.needsUpdate = true;
var materialImg2 = THREE.ImageUtils.loadTexture('Castle/img/castle_floor.png');
var img2 = new THREE.MeshBasicMaterial({ map: materialImg2, transparent:true });
var materialImg_hs = THREE.ImageUtils.loadTexture('Castle/img/heart.png');
var img_hs= new THREE.MeshBasicMaterial({ map: materialImg_hs, transparent:true });
hotspots = new THREE.Object3D();
planes=new THREE.Object3D();
geom = new THREE.BoxGeometry( 13, 13, 13 )
mat = new THREE.MeshBasicMaterial({color: 0xFF00FF, transparent: true, opacity: 0})
cube = new THREE.Mesh(geom, mat );
cube.position.x = 52;
cube.position.y = 32;
cube.position.z = 80
geom = new THREE.BoxGeometry( 5, 18, 12)
mat = new THREE.MeshBasicMaterial({color: 0xFF00FF, transparent: true, opacity: 0.5})
cube2 = new THREE.Mesh(geom, mat);
cube2.position.x = -38
cube2.position.y = 10
cube2.position.z = -90
//cube2.rotation.x = (-Math.PI / 2);
cube2.rotation.y = (0.31);
plane1 = new THREE.Mesh(new THREE.PlaneGeometry(2281, 614),img1);
plane1.overdraw = true;
plane1.rotation.x = (-Math.PI / 2);
plane1.rotation.z = (-1.15);
plane1.position.x = 25;
plane1.position.y = 3;
plane1.position.z = -48;
plane1.scale.x = 0.116;
plane1.scale.y = 0.160;
plane1.scale.z= 0.14;
plane2 = new THREE.Mesh(new THREE.PlaneGeometry(2281, 614),img2);
plane2.overdraw = true;
plane2.rotation.x = (-Math.PI / 2);
plane2.rotation.z = (-1.15);
plane2.position.x = 25;
plane2.position.y = 15;
plane2.position.z = -48;
plane2.scale.x = 0.116;
plane2.scale.y = 0.160;
plane2.scale.z= 0.14;
plane_hs = new THREE.Mesh(new THREE.PlaneGeometry(961, 870),img_hs);
plane_hs.overdraw = true;
plane_hs.position.x = 52;
plane_hs.position.y = 80;
plane_hs.position.z = 80;
plane_hs.scale.x = 0.05;
plane_hs.scale.y = 0.05;
plane_hs.scale.z = 0.05;
viewer.scenePointCloud.add(hotspots);
hotspots.add(cube);
//hotspots.add(cube2);
//hotspots.add(cube3);
viewer.scenePointCloud.add(planes);
planes.add(plane1);
planes.add(plane2);
planes.add(plane_hs);
plane1.visible=false
plane2.visible=false
plane_hs.visible=false
plane_hs.lookAt(viewer.camera.position);
//addCheckRaster(plane1,plane2)
//document.addEventListener('mouseover', onMouseOver, false);
document.addEventListener('mousedown', onDocumentMouseDown, false);
document.addEventListener('mousemove', onMouseMove, false);
</script>
</body>
</html>