Reputation: 41
I need to test ray-model intersections. I know that there is a build in method to test a ray intersection with Viewport3D ( https://blogs.msdn.microsoft.com/wpf3d/2009/05/18/3d-hit-testing/ )
I can't find any way to use it to test a Model3D. I need to test whole model for intersection, not only a visible part.
Any help will be very appreciated.
Upvotes: 1
Views: 1004
Reputation: 41
Ok. I think I have found a solution. What I can do is:
ModelVisual3D testModel = new ModelVisual3D();
testModel.Content = model; //model is Model3DGroup
...
RayHitTester(testModel, origin, direction);
And it works as supposed!
Upvotes: 1