77 lines
2.2 KiB
HTML
77 lines
2.2 KiB
HTML
<html>
|
|
<head>
|
|
|
|
<link rel="stylesheet" type="text/css" href="resources/style/potree.css" />
|
|
<script type="text/javascript" src="src/Potree.js"></script>
|
|
<script type="text/javascript" >Potree.importScripts("./");</script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
function DemoKeyListener(material){
|
|
this.material = material;
|
|
}
|
|
|
|
DemoKeyListener.prototype.invokeKeyPress = function(event){
|
|
console.log(event.keyCode);
|
|
if(event.keyCode == KeyCodes.NUMBER_1){
|
|
this.material.renderMode = PointCloudRenderMode.WEIGHTED_CIRCLE;
|
|
}else if(event.keyCode == KeyCodes.NUMBER_2){
|
|
this.material.renderMode = PointCloudRenderMode.FILTERED_SPLAT;
|
|
}
|
|
}
|
|
DemoKeyListener.prototype.invokeKeyDown = function(){}
|
|
DemoKeyListener.prototype.invokeKeyUp = function(){}
|
|
|
|
function init() {
|
|
var canvas = document.getElementById("canvas");
|
|
var success = Potree.init(canvas);
|
|
if(!success){
|
|
return;
|
|
}
|
|
|
|
var scene = Potree.currentScene;
|
|
var cloudURL = "resources/pointclouds/lion_takanawa/cloud.js";
|
|
|
|
var pcoNode = POCLoader.load(cloudURL);
|
|
scene.rootNode.addChild(pcoNode);
|
|
|
|
pcoNode.transform = [1, 0, 0, 0,
|
|
0, -1, 0, 0,
|
|
0, 0, 1, 0,
|
|
0, 0, 0, 1];
|
|
|
|
var cam = scene.activeCamera;
|
|
cam.rotateY(Math.PI/2);
|
|
cam.translate(-1,-1,-1);
|
|
|
|
var material = MaterialManager.getMaterial("pointCloud");
|
|
// material.renderMode = PointCloudRenderMode.FILTERED_SPLAT;
|
|
Potree.Settings.LODMultiplicator = 20.0;
|
|
MaterialManager.getMaterial("pointCloud").pointSize = 1;
|
|
|
|
KeyListener.addListener(new DemoKeyListener(material));
|
|
|
|
|
|
canvas.focus();
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body onload="init()" class="claro" style="font-size: 62.5%;">
|
|
|
|
<div id="workarea" style="width: 100%; height: 100%">
|
|
<canvas id="canvas" width="800" height="600" tabIndex="1">
|
|
Your Browser does not support WebGL. Try the newest version of Firefox or Google Chrome.
|
|
</canvas>
|
|
</div>
|
|
|
|
<div id="infos" style="top: 0; bottom: 0; left: 10; right: 0; position: absolute; z-index: 100; font-size: 150%; background: #fff; top: 10px; width: 300px; height: 70px; padding: 10px 10px 15px 10px; border-radius: 4px">
|
|
a,s,d,w: move through scene<br>
|
|
drag mouse: rotate camera<br>
|
|
1: default rendermode<br>
|
|
2: filtered splats
|
|
</div>
|
|
|
|
</body>
|
|
</html> |