xeokit/xeokit-bim-viewer

Option to make selected objects not appear floating in front of others

xeolabs opened this issue · 5 comments

Feedback from user:

We would like to have Selection Tool work like Colorize Objects. The main difference is that we do not want the Selected Entity to be visible behind other solid materials (walls etc...).

unnamed

Possible options:

  1. have a BIMViewer configuration that switches the Selection tool between using the "selected" rendering effect and the "colorized" rendering effect
  2. have an EmphasisMaterial property that indicates whether we want selected objects to "glow through" other objects (current behaviour, where selected objects are post-rendered over the top of normal objects), or to just to have a different color

Notes:

(1) would allow us to have different colors on selected objects
(2) restricts us to the same color for all selected objects
(2) is likely cleaner than (1) architecturally, because xeokit's "colorized" was not intended for visualizing selected objects and may break user expectations (and require hacks)

Amoki commented

This is what I meant with xeokit/xeokit-sdk#493, but it's way better explained here

Solution

xeokit-bim-viewer

xeokit-sdk

Caveat

To make this work within the renderer, we need to make selected objects always appear opaque when selectedGlowThrough is false. Even transparent windows will appear opaque, as shown in the screenshot below.

This is a necessary hack at this point, because of the way renderer is currently architected. It will take a slightly deeper change to be able to preserve the original transparency of each selected object. However, perhaps the opacity is desirable?

Screenshot from 2022-02-21 16-24-44

Amoki commented

Is it possible to define different behavior for over and select?

@Amoki at the xeokit-sdk level it's supported for highlight and select, so could also be made to work for mouse-over as well.

Examples of selection and highlighting objects on mouse hover:

https://xeokit.github.io/xeokit-sdk/examples/#picking_canvas_mesh_highlight_glowThroughFalse
https://xeokit.github.io/xeokit-sdk/examples/#picking_canvas_mesh_selection_glowThroughFalse

Another possibility: Add Colorize tool #107