pack viewer into its own class vor simpler handling and to avoid globals

This commit is contained in:
mschuetz 2015-10-09 17:31:35 +02:00
parent b4b55d45e5
commit 8ca359972b
2 changed files with 1314 additions and 1288 deletions

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,10 @@
<script src="../libs/other/stats.min.js"></script>
<script src="../libs/other/dat.gui.min.js"></script>
<script src="../libs/other/BinaryHeap.js"></script>
<script src="../libs/tween/tween.min.js"></script>
<script src="../build/js/potree.js"></script>
<script src="./js/viewer.js"></script>
<script src="./js/ProgressBar.js"></script>
<!-- uncomment this to debug changes to the individual js files -->
@ -40,10 +42,10 @@
<!-- INCLUDE ADDITIONAL DEPENDENCIES HERE -->
<!-- INCLUDE SETTINGS HERE -->
<!--<script src="../libs/plasio/js/laslaz.js"></script>
<script src="../libs/plasio/js/laslaz.js"></script>
<script src="../libs/plasio/vendor/bluebird.js"></script>
<script src="../build/js/laslaz.js"></script>
-->
<!-- HEADING -->
<div class="info" style="position: absolute; left: 300px; right: 300px; top: 10px; text-align: center;">
@ -58,44 +60,48 @@
<!-- TOOLS -->
<div id="tools" style="position: fixed; width: 400px; bottom: 10px; right: 10px">
<img src="../resources/icons/earth_controls_1.png" onclick="useEarthControls()" title="Earth Controls"/>
<img src="../resources/icons/fps_controls.png" onclick="useFPSControls()" title="Fly Camera"/>
<img src="../resources/icons/orbit_controls.png" onclick="useOrbitControls()" title="Orbit Controls"/>
<img src="../resources/icons/focus.png" onclick="camera.zoomTo(pointcloud)" title="focus on pointcloud"/>
<img src="../resources/icons/flip_y_z.png" onclick="flipYZ()" title="flip y and z coordinates"/>
<img src="../resources/icons/angle.png" onclick="measuringTool.startInsertion({showDistances: false, showAngles: true, showArea: false, closed: true, maxMarkers: 3})" title="angle measurements"/>
<img src="../resources/icons/distance.png" onclick="measuringTool.startInsertion({showDistances: true, showArea: false, closed: false})" title="distance measurements"/>
<img src="../resources/icons/area.png" onclick="measuringTool.startInsertion({showDistances: true, showArea: true, closed: true})" title="area measurements"/>
<img src="../resources/icons/volume.png" onclick="volumeTool.startInsertion()" title="volume measurements"/>
<img src="../resources/icons/profile.png" onclick="profileTool.startInsertion({width: pointcloud.boundingSphere.radius / 100})" title="height profiles"/>
<img src="../resources/icons/clip_volume.png" onclick="volumeTool.startInsertion({clip: true})" title="clipping volumes"/>
<img src="../resources/icons/earth_controls_1.png" onclick="viewer.useEarthControls()" title="Earth Controls"/>
<img src="../resources/icons/fps_controls.png" onclick="viewer.useFPSControls()" title="Fly Camera"/>
<img src="../resources/icons/orbit_controls.png" onclick="viewer.useOrbitControls()" title="Orbit Controls"/>
<img src="../resources/icons/focus.png" onclick="viewer.camera.zoomTo(viewer.pointcloud)" title="focus on pointcloud"/>
<img src="../resources/icons/flip_y_z.png" onclick="viewer.flipYZ()" title="flip y and z coordinates"/>
<img src="../resources/icons/angle.png" onclick="viewer.measuringTool.startInsertion({showDistances: false, showAngles: true, showArea: false, closed: true, maxMarkers: 3})" title="angle measurements"/>
<img src="../resources/icons/distance.png" onclick="viewer.measuringTool.startInsertion({showDistances: true, showArea: false, closed: false})" title="distance measurements"/>
<img src="../resources/icons/area.png" onclick="viewer.measuringTool.startInsertion({showDistances: true, showArea: true, closed: true})" title="area measurements"/>
<img src="../resources/icons/volume.png" onclick="viewer.volumeTool.startInsertion()" title="volume measurements"/>
<img src="../resources/icons/profile.png" onclick="viewer.profileTool.startInsertion({width: viewer.pointcloud.boundingSphere.radius / 100})" title="height profiles"/>
<img src="../resources/icons/clip_volume.png" onclick="viewer.volumeTool.startInsertion({clip: true})" title="clipping volumes"/>
</div>
<div id="renderArea"></div>
<script>
var sceneProperties = {
path: "http://5.9.65.151/mschuetz/potree/resources/pointclouds/pix4d/matterhorn/cloud.js",
path: "../resources/pointclouds/lion_takanawa/cloud.js",
path: "http://5.9.65.151/mschuetz/potree/resources/pointclouds/vermessung_zh_ch/zuerich/cloud.js",
path: "http://localhost/dev/pointclouds/opentopography/CA13_SAN_SIM/selection_converted/cloud.js",
path: "http://5.9.65.151/mschuetz/potree/test/cloud.js",
path: "http://localhost/temp/test/cloud.js",
<script>
var settings = {
path: "../resources/pointclouds/vol_total/cloud.js",
path: "../resources/pointclouds/lion_takanawa/cloud.js",
path: "http://5.9.65.151/mschuetz/potree/test/cloud.js",
cameraPosition: null,
cameraTarget: null,
sizeType: "Adaptive", // options: "Fixed", "Attenuated", "Adaptive"
quality: "Squares", // options: "Squares", "Circles", "Interpolation", "Splats"
quality: "Squares", // options: "Squares", "Circles", "Interpolation", "Splats"
fov: 75, // field of view in degree
material: "RGB", // options: "RGB", "Height", "Intensity", "Classification"
pointLimit: 1, // max number of points in millions
navigation: "Orbit", // options: "Earth", "Orbit", "Flight"
pointSize: 1,
useEDL: false, // eye-dome-lighting, especially usefull for point clouds without normals
pointSize: 1,
useEDL: true, // eye-dome-lighting, especially useful for point clouds without normals
};
var onPointCloudLoaded = function(event){
console.log("point cloud loaded");
};
var canvas = document.getElementById("renderArea");
viewer = new Potree.Viewer(canvas, settings, {
"onPointCloudLoaded": onPointCloudLoaded
});
</script>
<script src="./js/viewer.js"></script>
</body>
</html>