helix-toolkit icon indicating copy to clipboard operation
helix-toolkit copied to clipboard

Listen to mouse events for creating a selection box

Open beckmx opened this issue 6 years ago • 2 comments

Hello guys, I am reading the docs and I would like to create a rectangle from the mouse selection on a plane only, does anyone happen to have an example or similar? I saw this class but not really sure how to use it https://www.csharpcodi.com/vs2/2157/helix-toolkit/Source/HelixToolkit.Wpf/SelectionCommands/RectangleSelectionCommand.cs/

beckmx avatar Nov 27 '19 07:11 beckmx

One quick way is to project all models' bounding box/bounding sphere inside current view frustum onto 2D screen space. Then compare the projected bounds with your rectangle. If you want accurate selection, then you have to compare each triangles of models.

holance avatar Dec 06 '19 06:12 holance

I am also try to find similar solution. Did you find any examples can share ? (for sharpdx)

wdc63 avatar May 22 '22 14:05 wdc63