PDA

View Full Version : Which picking method would you recommend?



Batti
07-03-2002, 03:49 AM
Hi!

I have a 3d-file read in which can contain millions of objects. Iīd like to add picking now so that the user can obtain properties of letīs say a bridge. In future it would be great to even change properties interactively. Which picking method would you recommend considering my rather low programming skills? Would you prefer the common OpenGL picking or the color-picking and why? (Shooting a ray or using glUnproject sounds too difficult to me)
Thanks for any help!

Robbo
07-03-2002, 04:08 AM
Firstly, I am assuming your `millions of objects' are stored in some kind of `soup' with no internal structure such as BSP tree, Octree etc. If this is the case then shooting a ray would probably not be quicker than opengl picking. The advantage of ray-casting into the scene comes when you are quickly able to classify an object with respect to the ray, thus eliminating all subobjects from the search.

OpenGL picking is preferable to colour picking - for sure with that many objects.

Batti
07-03-2002, 04:55 AM
<blush>
The actual pickable objects are not millions, sorry, but about 200.000 max.
</blush>
Thanks for the reply! Why would you not use color-picking? Is it because you have to render the scene twice - so a matter of efficiency?

edit: your assumption is right.
2nd edit: Yet couldnīt I assign a colour to only those objects lying in my frustum? That would raise efficiency enormously wouldnīt it?

[This message has been edited by Batti (edited 07-03-2002).]

[This message has been edited by Batti (edited 07-03-2002).]

Robbo
07-03-2002, 05:25 AM
OpenGL will clip to a frustum 1 pixel by 1 pixel in size (or whatever you set the pick to be) - so if you are not currently clipping to frustum in software, this will make sure everything is rejected. Also, OpenGL picking will return pick records in hierarchy (if you need this) and multiple objects at different depths at the same position.

Batti
07-03-2002, 06:18 AM
Sounds convincing http://www.opengl.org/discussion_boards/ubb/smile.gif
Thanks again!