wavelet
wavelet

Reputation: 41

Ray hit testing with Model3D

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

Answers (1)

wavelet
wavelet

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

Related Questions