Archived

This topic is now archived and is closed to further replies.

wfrost

Mouse Selection

Recommended Posts

I am using a heightmap-based terrain with a camera view that is predominantly top-down. I''d like to know an efficient method of mouse selection to select portions (i.e., individual tris) of the terrain. I am dividing my terrain into 16k tri patches, however, that is still far too many tris to evaluate when using ray-tri intersection tests. When I shoot the ray down the current camera view, how can I perform collision tests on the fewest tris possible? I am using quadtrees for spacial queries for the purpose of object-object collision detection. That works well because the number of objects in each quad is relatively small. However, I don''t see how this method can work with terrain. Can anyone point me in the right direction? Is there a more efficient mouse selection techqniue given my environment?

Share this post


Link to post
Share on other sites
Depending on the difference between the highest point and lowest point, maybe you could create a plane that is parrallel to the heightmap and at the highest point. Intersect the ray with that, then find the grid coordinate of the patch (2 tris) the intersection is over, then intersect the ray with a couple of patches around it (9 patches or 18 tris). Hope that makes more sense than I think it does

--------------------------------------------------------
Life would be so much easier if we could just get the source code.

Share this post


Link to post
Share on other sites