4

I have a big ModelVisual3D (e.g. car) which is divided into many smaller GeometryModel3D objects (e.g. tyres, seats, wheels, etc.).

I would like to hit test the ModelVisual3D when the mouse is clicked and determine which GeometryModel3D was hit. I can hit test my car (the ModelVisual3D) but cannot determine which part of the car (the GeometryModel3D objects) was clicked.

Does anybody have an idea how I can determine the exact part of my model when handling a MouseLeftButtonDown event (or any other Mouse event)?

Matt
  • 4,318
  • 1
  • 27
  • 28
Silver Mikk
  • 43
  • 1
  • 3

2 Answers2

0

Have a look at http://www.kindohm.com/technical/ComplexVisuals.htm - I believe the mechanisms explained there will help.

user816098
  • 262
  • 3
  • 14
0

This blog post shows how to do ray testing with the framework:

http://blogs.msdn.com/b/wpf3d/archive/2009/05/18/3d-hit-testing.aspx

The result in the callback has detail on the intersected mesh from which you can get the specific part of the mesh which was intersected.

codekaizen
  • 26,990
  • 7
  • 84
  • 140