PDA

View Full Version : Selection buffer



fox
10-09-2000, 02:55 AM
Any one explain how to implement this?(and provide code/example?)

Thanx in advance

Khrob
10-09-2000, 06:56 AM
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!

fox
10-11-2000, 03:36 AM
Any details of implementation?

Pauly
10-11-2000, 04:31 AM
Basic selection code on my site:
http://home.clara.net/paulyg/ogl.htm

fox
10-12-2000, 02:27 AM
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?