fixing bugs and updating examples

This commit is contained in:
m-schuetz 2019-11-09 19:09:19 +01:00
parent 28b8765045
commit 889a7d2f34
10 changed files with 49 additions and 61 deletions

View File

@ -63,14 +63,14 @@
viewer.scene.addPointCloud(e.pointcloud); viewer.scene.addPointCloud(e.pointcloud);
e.pointcloud.position.z = 0; e.pointcloud.position.z = 0;
let material = e.pointcloud.material; let material = e.pointcloud.material;
material.size = 1; material.size = 0.8;
material.pointSizeType = Potree.PointSizeType.FIXED; material.pointSizeType = Potree.PointSizeType.ADAPTIVE;
material.activeAttributeName = "classification"; material.activeAttributeName = "RGBA";
viewer.scene.view.position.set(694991.9150582966, 3916274.3733733483, 76.41774609890476); viewer.scene.view.setView(
viewer.scene.view.lookAt(694878.4097257275, 3916332.0674868184, 14.497470898558227); [694517.403, 3899262.595, 10642.698],
[694878.410, 3916332.067, 14.497],
//viewer.fitToScreen(); );
}); });
</script> </script>

View File

@ -51,13 +51,13 @@
<img src="examples/thumbnails/lion_las.png" width="100%" /> <img src="examples/thumbnails/lion_las.png" width="100%" />
</a> </a>
</td><td> </td><td>
<a href="lion_laz.html" target="_blank"> <a href="ept.html" target="_blank">
<img src="examples/thumbnails/lion_las.png" width="100%" /> <img src="examples/thumbnails/lion_las.png" width="100%" />
</a> </a>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Toolbar</th><th>Basic Viewer</th><th>Heidentor</th><th>Lion</th><th>Lion LAS</th><th>Lion LAZ</th> <th>Toolbar</th><th>Basic Viewer</th><th>Heidentor</th><th>Lion</th><th>Lion LAS</th><th>EPT</th>
</tr><tr> </tr><tr>
<td> <td>
<a href="ca13.html" target="_blank"> <a href="ca13.html" target="_blank">
@ -80,19 +80,15 @@
<img src="examples/thumbnails/meshes.png" width="100%" /> <img src="examples/thumbnails/meshes.png" width="100%" />
</a> </a>
</td><td> </td><td>
<a href="lines.html" target="_blank"> <a href="multiple_pointclouds.html" target="_blank">
<img src="examples/thumbnails/lines.png" width="100%" /> <img src="examples/thumbnails/multiple_point_clouds.png" width="100%" />
</a> </a>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>CA13</th><th>Clipping Volume</th><th>Elevation Profile</th><th>Measurements</th><th>Meshes</th><th>Lines</th> <th>CA13</th><th>Clipping Volume</th><th>Elevation Profile</th><th>Measurements</th><th>Meshes</th><th>Multiple Point Clouds</th>
</tr><tr> </tr><tr>
<td> <td>
<a href="multiple_pointclouds.html" target="_blank">
<img src="examples/thumbnails/multiple_point_clouds.png" width="100%" />
</a>
</td><td>
<a href="features_sorvilier.html" target="_blank"> <a href="features_sorvilier.html" target="_blank">
<img src="examples/thumbnails/features_sorvilier.png" width="100%" /> <img src="examples/thumbnails/features_sorvilier.png" width="100%" />
</a> </a>
@ -112,16 +108,16 @@
<a href="animation_paths.html" target="_blank"> <a href="animation_paths.html" target="_blank">
<img src="examples/thumbnails/animation_paths.png" width="100%" /> <img src="examples/thumbnails/animation_paths.png" width="100%" />
</a> </a>
</td> </td><td>
</tr>
<tr>
<th>Multiple Point Clouds</th><th>Features (Sorvilier)</th><th>Features (CA13)</th><th>Annotations</th><th>Hierarchical Annotations</th><th>Animation Path</th>
</tr><tr>
<td>
<a href="shapefiles.html" target="_blank"> <a href="shapefiles.html" target="_blank">
<img src="examples/thumbnails/shapefiles.png" width="100%" /> <img src="examples/thumbnails/shapefiles.png" width="100%" />
</a> </a>
</td><td> </td>
</tr>
<tr>
<th>Features (Sorvilier)</th><th>Features (CA13)</th><th>Annotations</th><th>Hierarchical Annotations</th><th>Animation Path</th><th>Shapefiles</th>
</tr><tr>
<td>
<a href="cesium_ca13.html" target="_blank"> <a href="cesium_ca13.html" target="_blank">
<img src="examples/thumbnails/cesium_ca13.png" width="100%" /> <img src="examples/thumbnails/cesium_ca13.png" width="100%" />
</a> </a>
@ -141,26 +137,18 @@
<a href="embedded_iframe.html" target="_blank"> <a href="embedded_iframe.html" target="_blank">
<img src="examples/thumbnails/embedded_iframe.png" width="100%" /> <img src="examples/thumbnails/embedded_iframe.png" width="100%" />
</a> </a>
</td> </td><td>
</tr>
<tr>
<th>Shapefiles</th><th>Cesium CA13</th><th>Cesium Retz</th><th>Cesium Sorvilier</th><th>Custom Sidebar Section</th><th>Embedded Iframe</th>
</tr><tr>
<td>
<a href="gradient_colors.html" target="_blank"> <a href="gradient_colors.html" target="_blank">
<img src="examples/thumbnails/gradient_colors.png" width="100%" /> <img src="examples/thumbnails/gradient_colors.png" width="100%" />
</a> </a>
</td><td>
<a href="light_animated.html" target="_blank">
<img src="examples/thumbnails/light_animated.png" width="100%" />
</a>
</td><td>
<a href="light_ca13.html" target="_blank">
<img src="examples/thumbnails/light_ca13.png" width="100%" />
</a>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Gradient Colors</th><th>Animated Light</th><th>Light CA13</th> <th>Cesium CA13</th><th>Cesium Retz</th><th>Cesium Sorvilier</th><th>Custom Sidebar Section</th><th>Embedded Iframe</th><th>Gradient Colors</th>
</tr><tr>
</tr>
<tr>
</tr> </tr>
</table> </table>

View File

@ -59,7 +59,7 @@
viewer.setMinNodeSize(0); viewer.setMinNodeSize(0);
viewer.loadSettingsFromURL(); viewer.loadSettingsFromURL();
viewer.setDescription(""); viewer.setDescription(`Heidentor point cloud courtesy of <a href="http://archpro.lbg.ac.at/" target="_blank">Ludwig Boltzmann Institute - Archeological Prospection and Virtual Archeology</a> (26M points)`);
viewer.loadGUI(() => { viewer.loadGUI(() => {
viewer.setLanguage('en'); viewer.setLanguage('en');

View File

@ -12,14 +12,13 @@
{"thumb": "thumbnails/heidentor.png", "label": "Heidentor", "url": "heidentor.html"}, {"thumb": "thumbnails/heidentor.png", "label": "Heidentor", "url": "heidentor.html"},
{"thumb": "thumbnails/lion.png", "label": "Lion", "url": "lion.html"}, {"thumb": "thumbnails/lion.png", "label": "Lion", "url": "lion.html"},
{"thumb": "thumbnails/lion_las.png", "label": "Lion LAS", "url": "lion_las.html"}, {"thumb": "thumbnails/lion_las.png", "label": "Lion LAS", "url": "lion_las.html"},
{"thumb": "thumbnails/lion_las.png", "label": "Lion LAZ", "url": "lion_laz.html"}, {"thumb": "thumbnails/lion_las.png", "label": "EPT", "url": "ept.html"},
{"thumb": "thumbnails/ca13.png", "label": "CA13", "url": "ca13.html"}, {"thumb": "thumbnails/ca13.png", "label": "CA13", "url": "ca13.html"},
{"thumb": "thumbnails/clipping_volume.png", "label": "Clipping Volume", "url": "clipping_volume.html"}, {"thumb": "thumbnails/clipping_volume.png", "label": "Clipping Volume", "url": "clipping_volume.html"},
{"thumb": "thumbnails/elevation_profile.png", "label": "Elevation Profile", "url": "elevation_profile.html"}, {"thumb": "thumbnails/elevation_profile.png", "label": "Elevation Profile", "url": "elevation_profile.html"},
{"thumb": "thumbnails/measurements.png", "label": "Measurements", "url": "measurements.html"}, {"thumb": "thumbnails/measurements.png", "label": "Measurements", "url": "measurements.html"},
{"thumb": "thumbnails/meshes.png", "label": "Meshes", "url": "meshes.html"}, {"thumb": "thumbnails/meshes.png", "label": "Meshes", "url": "meshes.html"},
{"thumb": "thumbnails/lines.png", "label": "Lines", "url": "lines.html"},
{"thumb": "thumbnails/multiple_point_clouds.png", "label": "Multiple Point Clouds", "url": "multiple_pointclouds.html"}, {"thumb": "thumbnails/multiple_point_clouds.png", "label": "Multiple Point Clouds", "url": "multiple_pointclouds.html"},
{"thumb": "thumbnails/features_sorvilier.png", "label": "Features (Sorvilier)", "url": "features_sorvilier.html"}, {"thumb": "thumbnails/features_sorvilier.png", "label": "Features (Sorvilier)", "url": "features_sorvilier.html"},
@ -34,9 +33,7 @@
{"thumb": "thumbnails/cesium_sorvilier.png", "label": "Cesium Sorvilier", "url": "cesium_sorvilier.html"}, {"thumb": "thumbnails/cesium_sorvilier.png", "label": "Cesium Sorvilier", "url": "cesium_sorvilier.html"},
{"thumb": "thumbnails/custom_sidebar_section.png", "label": "Custom Sidebar Section", "url": "custom_sidebar_section.html"}, {"thumb": "thumbnails/custom_sidebar_section.png", "label": "Custom Sidebar Section", "url": "custom_sidebar_section.html"},
{"thumb": "thumbnails/embedded_iframe.png", "label": "Embedded Iframe", "url": "embedded_iframe.html"}, {"thumb": "thumbnails/embedded_iframe.png", "label": "Embedded Iframe", "url": "embedded_iframe.html"},
{"thumb": "thumbnails/gradient_colors.png", "label": "Gradient Colors", "url": "gradient_colors.html"}, {"thumb": "thumbnails/gradient_colors.png", "label": "Gradient Colors", "url": "gradient_colors.html"}
{"thumb": "thumbnails/light_animated.png", "label": "Animated Light", "url": "light_animated.html"},
{"thumb": "thumbnails/light_ca13.png", "label": "Light CA13", "url": "light_ca13.html"}
], ],
"showcase": [ "showcase": [
{"thumb": "thumbnails/chiller.jpg", "label": "Chiller", "url": "showcase/chiller.html"}, {"thumb": "thumbnails/chiller.jpg", "label": "Chiller", "url": "showcase/chiller.html"},

View File

@ -143,7 +143,7 @@ export class LasLazBatcher{
let indices = new Uint8Array(e.data.indices); let indices = new Uint8Array(e.data.indices);
geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3)); geometry.addAttribute('position', new THREE.BufferAttribute(positions, 3));
geometry.addAttribute('RGBA', new THREE.BufferAttribute(colors, 4, true)); geometry.addAttribute('color', new THREE.BufferAttribute(colors, 4, true));
geometry.addAttribute('intensity', new THREE.BufferAttribute(intensities, 1)); geometry.addAttribute('intensity', new THREE.BufferAttribute(intensities, 1));
geometry.addAttribute('classification', new THREE.BufferAttribute(classifications, 1)); geometry.addAttribute('classification', new THREE.BufferAttribute(classifications, 1));
geometry.addAttribute('return number', new THREE.BufferAttribute(returnNumbers, 1)); geometry.addAttribute('return number', new THREE.BufferAttribute(returnNumbers, 1));

View File

@ -53,7 +53,7 @@ export class EptBinaryLoader {
if (e.data.color) { if (e.data.color) {
let color = new Uint8Array(e.data.color); let color = new Uint8Array(e.data.color);
g.addAttribute('RGBA', new THREE.BufferAttribute(color, 4, true)); g.addAttribute('color', new THREE.BufferAttribute(color, 4, true));
} }
if (e.data.intensity) { if (e.data.intensity) {
let intensity = new Float32Array(e.data.intensity); let intensity = new Float32Array(e.data.intensity);

View File

@ -122,7 +122,7 @@ export class EptLazBatcher {
g.addAttribute('position', g.addAttribute('position',
new THREE.BufferAttribute(positions, 3)); new THREE.BufferAttribute(positions, 3));
g.addAttribute('RGBA', g.addAttribute('color',
new THREE.BufferAttribute(colors, 4, true)); new THREE.BufferAttribute(colors, 4, true));
g.addAttribute('intensity', g.addAttribute('intensity',
new THREE.BufferAttribute(intensities, 1)); new THREE.BufferAttribute(intensities, 1));

View File

@ -117,7 +117,7 @@ export class PointCloudMaterial extends THREE.RawShaderMaterial {
intensityRange: { type: "fv", value: [Infinity, -Infinity] }, intensityRange: { type: "fv", value: [Infinity, -Infinity] },
intensity_gbc: { type: "fv", value: [1, 0, 0]}, intensity_gbc: { type: "fv", value: [1, 0, 0]},
rgb_gbc: { type: "fv", value: [1, 0, 0]}, uRGB_gbc: { type: "fv", value: [1, 0, 0]},
// intensityGamma: { type: "f", value: 1 }, // intensityGamma: { type: "f", value: 1 },
// intensityContrast: { type: "f", value: 0 }, // intensityContrast: { type: "f", value: 0 },
// intensityBrightness:{ type: "f", value: 0 }, // intensityBrightness:{ type: "f", value: 0 },
@ -784,12 +784,12 @@ export class PointCloudMaterial extends THREE.RawShaderMaterial {
} }
get rgbGamma () { get rgbGamma () {
return this.uniforms.rgb_gbc.value[0]; return this.uniforms.uRGB_gbc.value[0];
} }
set rgbGamma (value) { set rgbGamma (value) {
if (this.uniforms.rgb_gbc.value[0] !== value) { if (this.uniforms.uRGB_gbc.value[0] !== value) {
this.uniforms.rgb_gbc.value[0] = value; this.uniforms.uRGB_gbc.value[0] = value;
this.dispatchEvent({ this.dispatchEvent({
type: 'material_property_changed', type: 'material_property_changed',
target: this target: this
@ -798,12 +798,12 @@ export class PointCloudMaterial extends THREE.RawShaderMaterial {
} }
get rgbContrast () { get rgbContrast () {
return this.uniforms.rgb_gbc.value[2]; return this.uniforms.uRGB_gbc.value[2];
} }
set rgbContrast (value) { set rgbContrast (value) {
if (this.uniforms.rgb_gbc.value[2] !== value) { if (this.uniforms.uRGB_gbc.value[2] !== value) {
this.uniforms.rgb_gbc.value[2] = value; this.uniforms.uRGB_gbc.value[2] = value;
this.dispatchEvent({ this.dispatchEvent({
type: 'material_property_changed', type: 'material_property_changed',
target: this target: this
@ -812,12 +812,12 @@ export class PointCloudMaterial extends THREE.RawShaderMaterial {
} }
get rgbBrightness () { get rgbBrightness () {
return this.uniforms.rgb_gbc.value[1]; return this.uniforms.uRGB_gbc.value[1];
} }
set rgbBrightness (value) { set rgbBrightness (value) {
if (this.uniforms.rgb_gbc.value[1] !== value) { if (this.uniforms.uRGB_gbc.value[1] !== value) {
this.uniforms.rgb_gbc.value[1] = value; this.uniforms.uRGB_gbc.value[1] = value;
this.dispatchEvent({ this.dispatchEvent({
type: 'material_property_changed', type: 'material_property_changed',
target: this target: this

View File

@ -168,7 +168,6 @@ class ProfilePointCloudEntry{
this.currentBatch.geometry.drawRange.count++; this.currentBatch.geometry.drawRange.count++;
} }
//for(let attribute of Object.values(this.currentBatch.geometry.attributes)){
for(let key of Object.keys(this.currentBatch.geometry.attributes)){ for(let key of Object.keys(this.currentBatch.geometry.attributes)){
let attribute = this.currentBatch.geometry.attributes[key]; let attribute = this.currentBatch.geometry.attributes[key];
attribute.updateRange.offset = updateRange.start; attribute.updateRange.offset = updateRange.start;

View File

@ -21,6 +21,8 @@ export class Sidebar{
this.measuringTool = viewer.measuringTool; this.measuringTool = viewer.measuringTool;
this.profileTool = viewer.profileTool; this.profileTool = viewer.profileTool;
this.volumeTool = viewer.volumeTool; this.volumeTool = viewer.volumeTool;
this.dom = $("#sidebar_root");
} }
createToolIcon(icon, title, callback){ createToolIcon(icon, title, callback){
@ -1291,7 +1293,9 @@ export class Sidebar{
initAppearance(){ initAppearance(){
$('#sldPointBudget').slider({ const sldPointBudget = this.dom.find('#sldPointBudget');
sldPointBudget.slider({
value: this.viewer.getPointBudget(), value: this.viewer.getPointBudget(),
min: 100 * 1000, min: 100 * 1000,
max: 10 * 1000 * 1000, max: 10 * 1000 * 1000,
@ -1299,7 +1303,7 @@ export class Sidebar{
slide: (event, ui) => { this.viewer.setPointBudget(ui.value); } slide: (event, ui) => { this.viewer.setPointBudget(ui.value); }
}); });
$('#sldFOV').slider({ this.dom.find('#sldFOV').slider({
value: this.viewer.getFOV(), value: this.viewer.getFOV(),
min: 20, min: 20,
max: 100, max: 100,
@ -1333,7 +1337,7 @@ export class Sidebar{
this.viewer.addEventListener('point_budget_changed', (event) => { this.viewer.addEventListener('point_budget_changed', (event) => {
$('#lblPointBudget')[0].innerHTML = Utils.addCommas(this.viewer.getPointBudget()); $('#lblPointBudget')[0].innerHTML = Utils.addCommas(this.viewer.getPointBudget());
$('#sldPointBudget').slider({value: this.viewer.getPointBudget()}); sldPointBudget.slider({value: this.viewer.getPointBudget()});
}); });
this.viewer.addEventListener('fov_changed', (event) => { this.viewer.addEventListener('fov_changed', (event) => {