third party examples and smaller fixes
@ -151,6 +151,57 @@
|
||||
|
||||
});
|
||||
|
||||
|
||||
{
|
||||
let manager = new THREE.LoadingManager();
|
||||
manager.onProgress = function ( item, loaded, total ) {
|
||||
console.log( item, loaded, total );
|
||||
};
|
||||
let textureLoader = new THREE.TextureLoader( manager );
|
||||
let texture = textureLoader.load(`${Potree.resourcePath}/textures/brick_pavement.jpg`);
|
||||
let onProgress = function ( xhr ) {
|
||||
if ( xhr.lengthComputable ) {
|
||||
let percentComplete = xhr.loaded / xhr.total * 100;
|
||||
console.log( Math.round(percentComplete, 2) + '% downloaded' );
|
||||
}
|
||||
};
|
||||
texture.wrapS = THREE.RepeatWrapping;
|
||||
texture.wrapT = THREE.RepeatWrapping;
|
||||
|
||||
let onError = function ( xhr ) {};
|
||||
let loader = new THREE.OBJLoader( manager );
|
||||
loader.load(`${Potree.resourcePath}/models/stanford_bunny_reduced.obj`, function ( object ) {
|
||||
object.traverse( function ( child ) {
|
||||
if ( child instanceof THREE.Mesh ) {
|
||||
child.material.map = texture;
|
||||
}
|
||||
} );
|
||||
|
||||
object.position.set(589871.587, 231528.213, 725.634);
|
||||
object.scale.multiplyScalar(500);
|
||||
object.rotation.set(Math.PI / 2, Math.PI, 0)
|
||||
|
||||
viewer.scene.scene.add( object );
|
||||
|
||||
viewer.onGUILoaded(() => {
|
||||
// Add entries to object list in sidebar
|
||||
let tree = $(`#jstree_scene`);
|
||||
let parentNode = "other";
|
||||
|
||||
let bunnyID = tree.jstree('create_node', parentNode, {
|
||||
text: "Bunny Textured",
|
||||
icon: `${Potree.resourcePath}/icons/triangle.svg`,
|
||||
data: object
|
||||
},
|
||||
"last", false, false);
|
||||
tree.jstree(object.visible ? "check_node" : "uncheck_node", bunnyID);
|
||||
|
||||
//tree.jstree("open_node", parentNode);
|
||||
});
|
||||
|
||||
}, onProgress, onError );
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -55,5 +55,24 @@
|
||||
{"thumb": "thumbnails/vol_total.jpg", "label": "Sorvilier", "url": "showcase/sorvilier.html"},
|
||||
{"thumb": "thumbnails/westend_palais.jpg", "label": "Westend Palais", "url": "showcase/westend_palais.html"},
|
||||
{"thumb": "thumbnails/whitby.jpg", "label": "Whitby", "url": "showcase/whitby.html"}
|
||||
],
|
||||
"thirdparty": [
|
||||
{"thumb": "third/sitn.jpg", "label": "SITN", "url": "https://sitn.ne.ch/lidar/"},
|
||||
{"thumb": "third/entwine.jpg", "label": "Entwine", "url": "http://potree.entwine.io/"},
|
||||
{"thumb": "third/laspublish.jpg", "label": "laspublish", "url": "https://rapidlasso.com/laspublish/"},
|
||||
{"thumb": "third/icgc_barcelona.jpg", "label": "Barcelona", "url": "http://betaportal.icgc.cat/wordpress/sagrada_familia_eixample_3d/"},
|
||||
{"thumb": "third/preikestolen.jpg", "label": "", "url": "https://www.linkedin.com/pulse/open-source-advent-21-partridge-potree-bj%C3%B8rn-ove-gr%C3%B8tan/?published=t"},
|
||||
{"thumb": "third/oklahoma_state_university.jpg", "label": "", "url": "http://geog.okstate.edu/users/mathews/potree/osuLib_nad.html"},
|
||||
{"thumb": "third/bermuda100.jpg", "label": "Bermuda 100", "url": "http://bermuda100.ucsd.edu/mary-celestia/index.php"},
|
||||
{"thumb": "third/pointbox.jpg", "label": "Pointbox", "url": "https://www.pointbox.xyz/"},
|
||||
{"thumb": "third/dublin.jpg", "label": "Dublin", "url": "https://digital.ucd.ie/view/ucdlib:30462"},
|
||||
{"thumb": "third/AHN2.jpg", "label": "AHN2", "url": "http://ahn2.pointclouds.nl/"},
|
||||
{"thumb": "third/phoenix_lidar.jpg", "label": "Phoenix Lidar", "url": "https://www.phoenixlidar.com/sampledata/"},
|
||||
{"thumb": "third/tatsumi_dam.jpg", "label": "Tatsumi Dam", "url": "http://www.kkapc.co.jp/potree-1.5RC/examples/apc_tatumi.html"},
|
||||
{"thumb": "third/ara.jpg", "label": "", "url": "http://www.airborneresearch.com.au/potree/ironbank1/examples/ironbank1.html"},
|
||||
{"thumb": "third/goldmine.jpg", "label": "", "url": "https://digitalreality.ethz.ch/goldmine/"},
|
||||
{"thumb": "third/ricketts_sanctuary.jpg", "label": "", "url": "http://files.digitisation.unimelb.edu.au/potree/pointclouds/ricketts-test2.html"},
|
||||
{"thumb": "third/hakea_macrorrhyncha.jpg", "label": "", "url": "http://files.digitisation.unimelb.edu.au/potree/pointclouds/hakea_macrorrhyncha.html"},
|
||||
{"thumb": "third/wesmapping_grand_canyon.jpg", "label": "Wesmapping", "url": "http://wesmapping.com/blog/3d-visualization-of-the-grand-canyon-with-potree/"}
|
||||
]
|
||||
}
|
||||
BIN
examples/third/AHN2.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
examples/third/ara.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
examples/third/bermuda100.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
examples/third/dublin.jpg
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
examples/third/entwine.jpg
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
examples/third/goldmine.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
examples/third/hakea_macrorrhyncha.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
examples/third/icgc_barcelona.jpg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
examples/third/laspublish.jpg
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
examples/third/oklahoma_state_university.jpg
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
examples/third/phoenix_lidar.jpg
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
examples/third/pointbox.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
examples/third/preikestolen.jpg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
examples/third/ricketts_sanctuary.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
examples/third/sitn.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
examples/third/tatsumi_dam.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
examples/third/wesmapping_grand_canyon.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
118
gulpfile.js
@ -206,6 +206,7 @@ gulp.task('examples_page', function() {
|
||||
let unhandledCode = ``;
|
||||
let exampleCode = ``;
|
||||
let showcaseCode = ``;
|
||||
let thirdpartyCode = ``;
|
||||
|
||||
{
|
||||
let urls = settings.examples.map(e => e.url);
|
||||
@ -235,29 +236,33 @@ gulp.task('examples_page', function() {
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
for(let example of settings.examples){
|
||||
exampleCode += `
|
||||
<a href="${example.url}" target="_blank" style="display: inline-block">
|
||||
<div class="thumb" style="background-image: url('${example.thumb}'); ">
|
||||
<div class="thumb-label">${example.label}</div>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
for(let example of settings.examples){
|
||||
exampleCode += `
|
||||
<a href="${example.url}" target="_blank" style="display: inline-block">
|
||||
<div class="thumb" style="background-image: url('${example.thumb}'); ">
|
||||
<div class="thumb-label">${example.label}</div>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
{
|
||||
for(let showcaseItem of settings.showcase){
|
||||
showcaseCode += `<a href="${showcaseItem.url}" target="_blank" style="display: inline-block">
|
||||
<div class="thumb" style="background-image: url('${showcaseItem.thumb}'); ">
|
||||
<div class="thumb-label">${showcaseItem.label}</div>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
for(let showcaseItem of settings.showcase){
|
||||
showcaseCode += `<a href="${showcaseItem.url}" target="_blank" style="display: inline-block">
|
||||
<div class="thumb" style="background-image: url('${showcaseItem.thumb}'); ">
|
||||
<div class="thumb-label">${showcaseItem.label}</div>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
for(let item of settings.thirdparty){
|
||||
thirdpartyCode += `<a href="${item.url}" target="_blank" style="display: inline-block">
|
||||
<div class="thumb" style="background-image: url('${item.thumb}'); ">
|
||||
<div class="thumb-label">${item.label}</div>
|
||||
</div>
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
|
||||
let page = `
|
||||
@ -271,13 +276,13 @@ gulp.task('examples_page', function() {
|
||||
}
|
||||
|
||||
.thumb{
|
||||
background-size: 160px 160px;
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
background-size: 140px 140px;
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
border-radius: 5px;
|
||||
border: 2px solid black;
|
||||
border: 1px solid black;
|
||||
box-shadow: 3px 3px 3px 0px #555;
|
||||
margin: 3px;
|
||||
margin: 0px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
@ -325,19 +330,70 @@ gulp.task('examples_page', function() {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
#samples_container{
|
||||
display: grid;
|
||||
grid-template-columns: 70% 30%;
|
||||
grid-gap: 10px;
|
||||
grid-template-rows: auto auto;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#thumb_container{
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 1;
|
||||
grid-row-start: 1;
|
||||
grid-row-end: 1;
|
||||
|
||||
max-width: 1200px;
|
||||
margin: auto;
|
||||
margin-top: 20px
|
||||
}
|
||||
|
||||
#external_container{
|
||||
grid-column-start: 2;
|
||||
grid-column-end: 2;
|
||||
grid-row-start: 1;
|
||||
grid-row-end: 2;
|
||||
|
||||
margin-top: 20px
|
||||
}
|
||||
|
||||
#showcase_container{
|
||||
grid-column-start: 1;
|
||||
grid-column-end: 1;
|
||||
grid-row-start: 2;
|
||||
grid-row-end: 2;
|
||||
|
||||
max-width: 1200px;
|
||||
margin: auto;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="thumb_container" style="max-width: 1200px; margin: auto; margin-top: 50px;">
|
||||
<h1>Examples</h1>
|
||||
${exampleCode}
|
||||
<div id="samples_container">
|
||||
|
||||
<div id="thumb_container">
|
||||
<h1>Examples</h1>
|
||||
${exampleCode}
|
||||
</div>
|
||||
|
||||
<div id="showcase_container">
|
||||
<h1>Showcase</h1>
|
||||
${showcaseCode}
|
||||
</div>
|
||||
|
||||
<div id="external_container">
|
||||
<h1>Third Party</h1>
|
||||
${thirdpartyCode}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="showcase_container" style="max-width: 1200px; margin: auto; margin-top: 50px;">
|
||||
<h1>Showcase</h1>
|
||||
${showcaseCode}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="unhandled_container">
|
||||
<h1>Other</h1>
|
||||
|
||||
@ -344,6 +344,7 @@ Potree.PointCloudOctree = class extends Potree.PointCloudTree {
|
||||
|
||||
{
|
||||
let bBox = node.getBoundingBox().clone();
|
||||
bBox.applyMatrix4(node.sceneNode.matrixWorld);
|
||||
bBox.applyMatrix4(camera.matrixWorldInverse);
|
||||
|
||||
let bSphere = bBox.getBoundingSphere();
|
||||
@ -380,6 +381,10 @@ Potree.PointCloudOctree = class extends Potree.PointCloudTree {
|
||||
let level = node.getLevel();
|
||||
let distance = value.distance;
|
||||
let i = value.i;
|
||||
|
||||
if(level < 4){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
//if(node.name === "r6646"){
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
#extension GL_EXT_frag_depth : enable
|
||||
#endif
|
||||
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
uniform mat4 viewMatrix;
|
||||
uniform mat4 uViewInv;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
#define max_clip_polygons 8
|
||||
#define PI 3.141592653589793
|
||||
@ -550,14 +550,14 @@ float getPointSize(){
|
||||
}
|
||||
#elif defined adaptive_point_size
|
||||
if(uUseOrthographicCamera) {
|
||||
float worldSpaceSize = 1.5 * size * r / getPointSizeAttenuation();
|
||||
float worldSpaceSize = 1.0 * size * r / getPointSizeAttenuation();
|
||||
pointSize = (worldSpaceSize / uOrthoWidth) * uScreenWidth;
|
||||
} else {
|
||||
|
||||
if(uIsLeafNode && false){
|
||||
pointSize = size * spacing * projFactor;
|
||||
}else{
|
||||
float worldSpaceSize = 1.5 * size * r / getPointSizeAttenuation();
|
||||
float worldSpaceSize = 1.0 * size * r / getPointSizeAttenuation();
|
||||
pointSize = worldSpaceSize * projFactor;
|
||||
}
|
||||
}
|
||||
|
||||
@ -736,6 +736,9 @@ Potree.TransformationTool = class TransformationTool {
|
||||
|
||||
this.scene.visible = true;
|
||||
|
||||
this.scene.updateMatrix();
|
||||
this.scene.updateMatrixWorld();
|
||||
|
||||
let selected = this.selection[0];
|
||||
let world = selected.matrixWorld;
|
||||
let camera = this.viewer.scene.getActiveCamera();
|
||||
@ -746,11 +749,11 @@ Potree.TransformationTool = class TransformationTool {
|
||||
|
||||
this.scene.scale.copy(selected.boundingBox.getSize().multiply(selected.scale));
|
||||
this.scene.position.copy(center);
|
||||
//this.scene.position.copy(selected.position);
|
||||
this.scene.rotation.copy(selected.rotation);
|
||||
|
||||
{
|
||||
this.scene.updateMatrixWorld();
|
||||
|
||||
{
|
||||
// adjust scale of components
|
||||
for(let handleName of Object.keys(this.handles)){
|
||||
let handle = this.handles[handleName];
|
||||
@ -872,7 +875,6 @@ Potree.TransformationTool = class TransformationTool {
|
||||
axisScale([0, 0, 1]),
|
||||
);
|
||||
|
||||
//this.frame.scale.copy(scale);
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
@ -228,6 +228,8 @@ class HQSplatRenderer {
|
||||
|
||||
viewer.renderer.render(viewer.scene.scene, camera);
|
||||
|
||||
viewer.dispatchEvent({type: "render.pass.scene", viewer: viewer});
|
||||
|
||||
Potree.endQuery(queryHQSplats, viewer.renderer.getContext());
|
||||
|
||||
viewer.renderer.clearDepth();
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
<option id="background_options_gradient" value="gradient">Gradient</option>
|
||||
<option id="background_options_black" value="black">Black</option>
|
||||
<option id="background_options_white" value="white">White</option>
|
||||
<option id="background_options_none" value="null">None</option>
|
||||
</selectgroup>
|
||||
</li>
|
||||
|
||||
|
||||