Event handler
#3
With EventManager3D you will be only able to get events when mouse is over the subscribed 3D objects.

To get mouse events when over the empty area, you will need to use manually hit testing instead of using EventManager3D. To do this, you will need to subscribe to mouse events on a Border or any other parent object from Viewport3D (if you subscribe to mouse events on Viewport3D, you will only get them when mouse is over any 3D object). The parent Border or other parent object need to have the Background property set (it can be set to Transparent). If the Background property is not set, then this area is not "occupied" by the Border or any other object.

When you are subscribed to mouse events, then check the "Standard WPF hit testing sample" that comes with Ab3d.PowerToys samples (EventManager3D\StandardWpfHitTestingDemo.xaml.cs) to see how to get hit 3D objects.

Note that if you will want to use the same mouse events for hit testing and for camera rotation and movement (for MouseCameraController), you will need to subscribe to PreviewMouse... events (so PreviewMouseDown instead of MouseDown). See the MouseSelectionAndRotation for more info about that.
Andrej Benedik
  


Messages In This Thread
Event handler - by kreativasas - 03-18-2020, 12:40 PM
RE: Event handler - by kreativasas - 03-19-2020, 10:44 AM
RE: Event handler - by abenedik - 03-20-2020, 10:38 AM
RE: Event handler - by kreativasas - 03-24-2020, 07:48 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)