Skip to content

Commit

Permalink
example(immersive): add debug UI, and change the name of 'WFS buildin…
Browse files Browse the repository at this point in the history
…gs' layer to 'Buildings', and increase background radius from 80 to 1 200
  • Loading branch information
gliegard committed Feb 21, 2019
1 parent 7cf6888 commit 513ad4a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions examples/immersive_paris.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
});

// limit camera far, to increase performance
view.camera.camera3D.far = 100;
view.camera.camera3D.far = 10000;
view.camera.camera3D.near = 0.1;

// open camera fov
Expand Down Expand Up @@ -107,7 +107,7 @@
// Create oriented image layer
var olayer = new itowns.OrientedImageLayer('demo_orientedImage', {
// Radius in meter of the sphere used as a background.
backgroundDistance: 80,
backgroundDistance: 1200,
source: orientedImageSource,
orientation: orientation,
calibration: calibration,
Expand Down Expand Up @@ -140,7 +140,7 @@
});

// create geometry layer for the buildings
var wfsBuildingLayer = new itowns.GeometryLayer('WFS Building', new itowns.THREE.Group(), {
var wfsBuildingLayer = new itowns.GeometryLayer('Buildings', new itowns.THREE.Group(), {
update: itowns.FeatureProcessing.update,
convert: itowns.Feature2Mesh.convert({
altitude: altitudeBuildings,
Expand All @@ -152,8 +152,11 @@
overrideAltitudeInToZero: true,
});

// add the created building layer
view.addLayer(wfsBuildingLayer);
// add the created building layer, and debug UI
view.addLayer(wfsBuildingLayer).then(function addDebugUI(buildingLayer) {
var gui = debug.GeometryDebug.createGeometryDebugUI(menuGlobe.gui, view, buildingLayer);
debug.GeometryDebug.addWireFrameCheckbox(gui, view, buildingLayer);
});
});

});
Expand All @@ -162,6 +165,9 @@
var menuGlobe = new GuiTools('menuDiv');
menuGlobe.view = view;

var d = new debug.Debug(view, menuGlobe.gui);
debug.createTileDebugUI(menuGlobe.gui, view, view.tileLayer, d);

// Listen for globe full initialisation event
view.addEventListener(itowns.GLOBE_VIEW_EVENTS.GLOBE_INITIALIZED, function () {

Expand All @@ -171,6 +177,7 @@
// set camera to current panoramic
view.controls.setCameraToCurrentPosition();
view.notifyChange(view.camera.camera3D);

});

</script>
Expand Down

0 comments on commit 513ad4a

Please # to comment.