read spacing from cloud.js; display only root from far away; added zoom factor to camera.zoomTo(node)
This commit is contained in:
parent
0a8ed33f74
commit
bab7b9991f
@ -78,7 +78,7 @@ Potree.PointCloudOctree.prototype.update = function(camera){
|
||||
|
||||
var visible = true;
|
||||
visible = visible && frustum.intersectsBox(box);
|
||||
if(object.level > 1){
|
||||
if(object.level > 0){
|
||||
visible = visible && radius / distance > (1 / this.LOD);
|
||||
visible = visible && (this.numVisiblePoints + object.numPoints < Potree.pointLoadLimit);
|
||||
visible = visible && (this.numVisibleNodes <= this.maxVisibleNodes);
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
|
||||
THREE.PerspectiveCamera.prototype.zoomTo = function(node){
|
||||
THREE.PerspectiveCamera.prototype.zoomTo = function(node, factor){
|
||||
if(factor === undefined){
|
||||
factor = 1;
|
||||
}
|
||||
|
||||
node.updateMatrixWorld();
|
||||
this.updateMatrix();
|
||||
this.updateMatrixWorld();
|
||||
@ -38,6 +42,7 @@ THREE.PerspectiveCamera.prototype.zoomTo = function(node){
|
||||
max = Math.max(max, distance);
|
||||
}
|
||||
var offset = dir.clone().multiplyScalar(-max);
|
||||
offset.multiplyScalar(factor);
|
||||
pos.add(offset);
|
||||
this.position.copy(pos);
|
||||
|
||||
|
||||
@ -32,6 +32,8 @@ POCLoader.load = function load(url) {
|
||||
pco.octreeDir = url + "/../" + fMno.octreeDir;
|
||||
}
|
||||
|
||||
pco.spacing = fMno.spacing;
|
||||
|
||||
var nodes = {};
|
||||
|
||||
{ // load root
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user