PDA

View Full Version : 'Heirarchal' picking



spiraguy
07-07-2003, 09:32 AM
Hello All,

I am implementing picking routines at the mo', and want to create a sort of 'heirarchal' picking structure, i.e. model1->part2->facet3 etc. I know that you can just push extra names onto the name stack e.g. glLoadName(model1); glPushName(part2) etc, but does anyone have any example code for hit-processing using this stacked naming technique? I just can't seem to get it to work...

dorbie
07-07-2003, 11:09 AM
You should try to draw the top level get the hit then for those items hit descend and do another separate querry. This way the hierarchy is a performance win, but you need a separate querry for each level in the tree, and you use the previous levels results as a filter for what you draw in the next level.

No example code should be required by you if you understand this simple principal.