Hi all,
I have a problem with doing pick.
I have a X file and it contains a scene.(many buildings)
What I want to do is that to click on somewhere
on the screen, my application may detect which
building it hit.
According to the sample provided by DirectX Documentation,
it may detect the MESH, but I want to detect FRAME....
Would you please do me a favor? Tell me how can I do?
Thx
Eric L.C. Shang-kuan
How to Do Pick?
in my scene model. every building is a frame hierachy. whcih contains many small meshs. I want to be able to pick every building. Is there any better way to do picking than checking every small mesh from these buildings? thanks~
build a ray from your camera position, your camera matrix and the screen position of your mouse pointer. have bounding spheres or boxes of all houses precalculated. then just loop through them, intersect the ray with each and see which it hits first. that''s your house.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement