builds; make hierarchyStepSize dependant on octreeDepth

This commit is contained in:
mschuetz 2015-03-13 11:20:32 +01:00
parent e6dde49a9d
commit 18f3347d46
3 changed files with 18 additions and 36 deletions

View File

@ -3570,24 +3570,14 @@ Potree.PointCloudOctreeGeometryNode.prototype.getURL = function(){
}
Potree.PointCloudOctreeGeometryNode.prototype.getHierarchyPath = function(){
var path = "";
var path = "r/";
var hierachyStepSize = this.pcoGeometry.hierarchyStepSize;
var hierarchyStepSize = this.pcoGeometry.hierarchyStepSize;
var indices = this.name.substr(1);
var numParts;
if(indices.length == 0){
numParts = 0;
}else{
numParts = Math.ceil(indices.length / hierachyStepSize);
}
if(numParts == 0){
path = "";
}else{
path = "";
for(var i = 0; i < numParts; i++){
path += "r" + indices.substr(0, i*hierachyStepSize) + "/";
}
var numParts = Math.floor(indices.length / hierarchyStepSize);
for(var i = 0; i < numParts; i++){
path += indices.substr(i * hierarchyStepSize, hierarchyStepSize) + "/";
}
return path;
@ -7098,7 +7088,8 @@ Potree.VolumeTool = function(scene, camera, renderer){
};
this.volume = function(){
return Math.abs(this.dimension.x * this.dimension.y * this.dimension.z);
return Math.abs(this.scale.x * this.scale.y * this.scale.z);
//return Math.abs(this.dimension.x * this.dimension.y * this.dimension.z);
};
this.update = function(){
@ -7277,7 +7268,8 @@ Potree.VolumeTool = function(scene, camera, renderer){
var wp = this.activeVolume.getWorldPosition().applyMatrix4(this.camera.matrixWorldInverse);
var pp = new THREE.Vector4(wp.x, wp.y, wp.z).applyMatrix4(this.camera.projectionMatrix);
var w = Math.abs((wp.z / 10));
this.activeVolume.setDimension(w, w, w);
//this.activeVolume.setDimension(w, w, w);
this.activeVolume.scale.set(w,w,w);
}
}

File diff suppressed because one or more lines are too long

View File

@ -44,24 +44,14 @@ Potree.PointCloudOctreeGeometryNode.prototype.getURL = function(){
}
Potree.PointCloudOctreeGeometryNode.prototype.getHierarchyPath = function(){
var path = "";
var path = "r/";
var hierachyStepSize = this.pcoGeometry.hierarchyStepSize;
var hierarchyStepSize = this.pcoGeometry.hierarchyStepSize;
var indices = this.name.substr(1);
var numParts;
if(indices.length == 0){
numParts = 0;
}else{
numParts = Math.ceil(indices.length / hierachyStepSize);
}
if(numParts == 0){
path = "";
}else{
path = "";
for(var i = 0; i < numParts; i++){
path += "r" + indices.substr(0, i*hierachyStepSize) + "/";
}
var numParts = Math.floor(indices.length / hierarchyStepSize);
for(var i = 0; i < numParts; i++){
path += indices.substr(i * hierarchyStepSize, hierarchyStepSize) + "/";
}
return path;