Jump to content
  • Advertisement
Sign in to follow this  
TheZver

help ! serious picking problem

This topic is 4095 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

large scene 1 large scene 1 hello all. im developing some sort of optics simulation program, and need to add picking and mouse-intersection info. the problem is that there are many surfaces , and some of them can consist of thousands of polygons. so, simple picking doesnt seem like an option to determinate the closest polygon that cursor points at, because the surfaces are generally stacked one in another in various shapes. i was thinking about other approaches like occlusion query, or depth stencil - where every surface will write its index to all drawn pixels of it on some buffer. then i will only need to check what surface was drawn at desired pixel, and to use simple picking on one surface.. can it be done using stencil buffer' and the videocard ? or i must unlock many huge surfaces, find intersecting triangles and compare all of them ? ( i wonder how programs like 3d studio max doing this with huge surfaces ) i will be happy to get any help or response. thanks

Share this post


Link to post
Share on other sites
Advertisement
You could try to use a BVH (eg AABB tree).
Another possibility would be to give each Polygon a unique color, render the scene to the backbuffer and look up the color of the pixel you clicked (RGB values would allow for 16,7 million unique IDs which should be enough).

Share this post


Link to post
Share on other sites
aabb is not an option because the vertex data in files that i must use comes without it and i cant do nothing about it ( creating it manually seems to bee too complicated and time consuming ):(

so, if there isnt a way to do something with only one rendering pass ( without shaders ) then rendering one more time to a region of one pixel in backbuffer (using scissor ) its really the best solution for me. thanks.

the deal is that i prefer to output data not only on mouse click, but per frame ( mouse move or scene change etc will be calling this calculations ). so any possible optimization is welcome.

thanks

[Edited by - TheZver on September 27, 2007 5:58:03 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!