Selection buffer

Any one explain how to implement this?(and provide code/example?)

Thanx in advance

I read about one technique… basically (forgive and dodgy details…) you do two rendering passes - once to your screen buffer, and then for each object, draw it in a flat colour (no lighting) into the stencil (or some other) buffer, and from there read that, match the colour at a particular point to which object is id’d by that colour and Robert’s your mother’s brother.

hope this helps!

Any details of implementation?

Basic selection code on my site:
http://home.clara.net/paulyg/ogl.htm

selection buffer doesn’t allow you to move objects around the scene does it? I think that would be ‘picking’ - any one have code for this - also would I need to implement selection as well for this to work?

I have a scene with a few objects -
I’ve got a drawCube function which stores the code for the cube and this can be passed values when called - while implementing the selection buffer I used drawCube(GLenum mode) and called the drawCube function in there - will this work?