kopia lustrzana https://github.com/OpenDroneMap/WebODM
Textured model display, cleanup, error handling, miscellaneous cleanup
rodzic
b2e0a9b1b2
commit
a2f146b725
|
@ -89,22 +89,17 @@ class ModelView extends React.Component {
|
|||
|
||||
// Sigeom
|
||||
Potree.loadPointCloud(this.potreeFilePath(), "", e => {
|
||||
if (e.type == "loading_failed"){
|
||||
this.setState({error: "Could not load point cloud. This task doesn't seem to have one. Try processing the task again."});
|
||||
return;
|
||||
}
|
||||
|
||||
let scene = viewer.scene;
|
||||
scene.addPointCloud(e.pointcloud);
|
||||
this.pointCloud = e.pointcloud;
|
||||
|
||||
//scene.view.position.set(589974.341, 231698.397, 986.146);
|
||||
//scene.view.lookAt(new THREE.Vector3(589851.587, 231428.213, 715.634));
|
||||
viewer.fitToScreen();
|
||||
});
|
||||
|
||||
|
||||
// if (error){
|
||||
// console.log(error);
|
||||
// this.setState({error: "Could not load point cloud. This task doesn't seem to have one. Try processing the task again."});
|
||||
// return;
|
||||
// }
|
||||
|
||||
viewer.fitToScreen();
|
||||
});
|
||||
}
|
||||
|
||||
toggleTexturedModel(e){
|
||||
|
@ -149,7 +144,9 @@ class ModelView extends React.Component {
|
|||
viewer.scene.scene.add(object);
|
||||
|
||||
this.modelReference = object;
|
||||
this.pointCloud.visible = false;
|
||||
|
||||
this.viewerOpacity = viewer.getOpacity();
|
||||
viewer.setOpacity(0);
|
||||
|
||||
this.setState({
|
||||
initializingModel: false,
|
||||
|
@ -159,11 +156,14 @@ class ModelView extends React.Component {
|
|||
}else{
|
||||
// Already initialized
|
||||
this.modelReference.visible = true;
|
||||
this.pointCloud.visible = false;
|
||||
|
||||
this.viewerOpacity = viewer.getOpacity();
|
||||
viewer.setOpacity(0);
|
||||
}
|
||||
}else{
|
||||
this.modelReference.visible = false;
|
||||
this.pointCloud.visible = true;
|
||||
|
||||
viewer.setOpacity(this.viewerOpacity);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
@import '../vendor/potree/js/jquery-ui.css';
|
||||
|
||||
[data-modelview]{
|
||||
height: 100%;
|
||||
height: 90%;
|
||||
}
|
||||
.model-view{
|
||||
position: relative;
|
||||
height: 80%;
|
||||
height: 100%;
|
||||
|
||||
canvas{
|
||||
width: 100% !important;
|
||||
|
@ -36,7 +36,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
input[type="checkbox"]{
|
||||
position: relative;
|
||||
top: 2px;
|
||||
|
|
|
@ -1849,6 +1849,10 @@ Potree.POCLoader.load = function load(url, callback) {
|
|||
callback(pco);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onloadend = function() {
|
||||
if(xhr.status == 404) callback();
|
||||
};
|
||||
|
||||
xhr.send(null);
|
||||
}catch(e){
|
||||
|
@ -12641,8 +12645,8 @@ Potree.Scene = class extends THREE.EventDispatcher{
|
|||
var light = new THREE.AmbientLight( 0x555555 ); // soft white light
|
||||
this.scenePointCloud.add( light );
|
||||
|
||||
let grid = Potree.utils.createGrid(5, 5, 2);
|
||||
this.scene.add(grid);
|
||||
// let grid = Potree.utils.createGrid(5, 5, 2);
|
||||
// this.scene.add(grid);
|
||||
|
||||
{// background
|
||||
// var texture = THREE.ImageUtils.loadTexture( Potree.resourcePath + '/textures/background.gif' );
|
||||
|
|
Ładowanie…
Reference in New Issue