Skip to content

Commit

Permalink
Merge pull request #1749 from paireks/fix/ObjectPicking
Browse files Browse the repository at this point in the history
[EXAMPLES] Fix picking examples
  • Loading branch information
xeolabs authored Dec 1, 2024
2 parents cdc4008 + ab31f42 commit 57716aa
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ <h3>Resources</h3>
viewer.camera.look = [4.40, 3.72, 8.89];
viewer.camera.up = [-0.01, 0.99, 0.039];

viewer.cameraControl.doublePickFlyTo = false;

//------------------------------------------------------------------------------------------------------------------
// Load a model
//------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions examples/buildings/glTF_Schependomlaan.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ <h3>Assets</h3>

viewer.scene.selectedMaterial.fillAlpha = 0.1;

viewer.cameraControl.doublePickFlyTo = false;

//----------------------------------------------------------------------------------------------------------------------
// Create a glTF loader plugin, load a glTF model, fit to view
//----------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions examples/buildings/glTF_VianneyHouse.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ <h3>Assets</h3>
viewer.camera.look = [13.44, 3.31, -14.83];
viewer.camera.up = [0.10, 0.98, -0.14];

viewer.cameraControl.doublePickFlyTo = false;

new ReflectionMap(viewer.scene, {
src: [
"../../assets/textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_PX.png",
Expand Down
2 changes: 2 additions & 0 deletions examples/buildings/glb_VianneyHouse.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ <h3>Assets</h3>
viewer.camera.look = [13.44, 3.31, -14.83];
viewer.camera.up = [0.10, 0.98, -0.14];

viewer.cameraControl.doublePickFlyTo = false;

// new ReflectionMap(viewer.scene, {
// src: [
// "../../assets/textures/reflect/Uffizi_Gallery/Uffizi_Gallery_Radiance_PX.png",
Expand Down
2 changes: 2 additions & 0 deletions examples/lidar/glb_Roadworks.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ <h3>Resources</h3>
viewer.camera.look = [-0.687950493700225, 0.9435747389607769, 0.21646512460703526];
viewer.camera.up = [0.309485261773766, 0.8413154758004762, -0.4431784549404927];

viewer.cameraControl.doublePickFlyTo = false;

const gltfLoader = new GLTFLoaderPlugin(viewer);

const sceneModel = gltfLoader.load({
Expand Down
8 changes: 5 additions & 3 deletions examples/picking/pick_setObjectsPickable.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ <h1>Controlling which objects are pickable</h1>
viewer.camera.look = [4.400, 3.724, 8.899];
viewer.camera.up = [-0.018, 0.999, 0.039];

viewer.cameraControl.doublePickFlyTo = false;

//----------------------------------------------------------------------------------------------------------------------
// Create a xeokit loader plugin, load a model, fit to view
//----------------------------------------------------------------------------------------------------------------------
Expand All @@ -64,16 +66,16 @@ <h1>Controlling which objects are pickable</h1>
});

//------------------------------------------------------------------------------------------------------------------
// Set all objects un-pickable and grey, except for the slab in front of the door, which we'll set pickable and blue
// Set all objects un-pickable and grey, except for the one wall in front of camera, which we'll set pickable and blue
//------------------------------------------------------------------------------------------------------------------

sceneModel.on("loaded", () => {

viewer.scene.setObjectsColorized(viewer.scene.objectIds, [0.4, 0.4, 0.4]);

viewer.scene.setObjectsColorized(["1CZILmCaHETO8tf3SgGEXu"], [0, 0, 1]);
viewer.scene.setObjectsColorized(["2O2Fr$t4X7Zf8NOew3FLOH"], [0, 0, 1]);

viewer.scene.setObjectsPickable(["1CZILmCaHETO8tf3SgGEXu"], true);
viewer.scene.setObjectsPickable(["2O2Fr$t4X7Zf8NOew3FLOH"], true);
});

//------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 57716aa

Please sign in to comment.