Mesh.Intersect

Started by
1 comment, last by Scylexan 17 years, 5 months ago
I was wondering if any knows how DirectX's Mesh.Intersect method works? I'm having some trouble searching for it. I'm trying to figure out how it actually performs the intersection tests and if it's faster than what I could write by hand. I would like to assume the developers of the API did a good job at accelerating the intersection tests and also that the tests are all ray/triangle tests; however, I never settle with just assumptions. Thanks.
STUMP - http://scyanidegaming.com
Advertisement
I don't have any hard facts for you, but I assume that they are just looping over all of the triangles in the mesh and doing a ray/tri intersect on it. I assumed this because it is rather slow for a large mesh (I used it for a while on some large terrain meshes). To speed it up, I wrote a KD-tree to divide up the triangles into smaller chunks and traverse that tree with the ray before looping over the tris that are in a small bounding box (leaf of the tree).

I can't think of how they would accelerate the intersect method unless they do some kind of hierarchy or grid to reduce the set of triangles to test with.

I haven't done any timings or tried to look at the code, so I am not absolutely certain, but I know my kd-tree is faster.
Thanks for the reply.

I actually was planning on implementing a KD-Tree but just curious if I was ok with using the builtin intersect calls or would I be better off creating my own intersect method. Glad to hear that it made things faster for you, I'll have to give it a try.
STUMP - http://scyanidegaming.com

This topic is closed to new replies.

Advertisement