[MDX] BoxBoundProbe .. wich is before the other

Started by
2 comments, last by Grattier 18 years, 1 month ago
Hi, I'm using geometry.BoxBoundProbe in my program for intersect testing.. it work #1 but there is no intersectinformation like mesh.intersect give.. So how can i know wich object is before the other?? .. If I can't, i will create a temp mesh instead of a boundboxprobe... test it and destroy it without drawing it. Thanks a+
Advertisement
Quote:Original post by Grattier
I'm using geometry.BoxBoundProbe in my program for intersect testing.. it work #1 but there is no intersectinformation like mesh.intersect give.. So how can i know wich object is before the other?? ..
Hmm, interesting. I presume MDX is the same as native in this case, but the only out/return data is a BOOL. No intersection information at all [oh]

A possible solution would be to use [D3DX]BoxBoundProbe() and if it returns TRUE then you can further interrogate it using [D3DX]IntersectTri(). Defining 12 triangles for a bounding box isn't difficult, and depending on context you might be able to reduce it to 6 (or less) due to back face culling.

Quote:Original post by Grattier
If I can't, i will create a temp mesh instead of a boundboxprobe... test it and destroy it without drawing it.
Don't create/destroy a mesh on every test - that'll really hurt performance. Instead, create a box mesh at the same time as you load/manipulate your geometry and keep re-using it for intersection tests.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Hum ok.. nice answer..

How does IntersectTri work? I never usedit.. can you give me a link where I can read on that or just explain me!

Thanks!
It's ok... intersectTri is easy to use... I'll think about the best method.

Thanks a+

This topic is closed to new replies.

Advertisement