Hi Rob,
Picking involves interleaving a special render, with a very small viewport at the mouse position, then collecting all the labelled (
glLoadName) objects whose surfaces appear within this view. The object with the nearest (lowest depth) surface, is the one chosen.
All this stuff is deployed in
inc/openglsceneframe.inc. If I had to do it again from scratch, I would struggle like a complete novice
. But you are welcome to use it in any shape or form.
Pick is the integrating keyword to look for.
inc/chaos.inc contains pseudorandom, chaotic, interpolation and noise frequency functions.