Mouse Selection

Hi. I have problem with implementing mouse selection.
For now i’m drawing a bunch of images and need to detect, if mouse clich occurs ower exact image.I know coords, rotation and scale for each image. It is simple, until i’m not using transformation routines, such as glTranslatef, glRotatef and glSizef. But with those transformations i have no idea how to implement mouse picking.
Thanks in advance.

yeah, that’s a tough one. hrrm…

a quick search turns up this, from the OpenGL Red Book:

in particular, the first section ‘selection’ mentions some functions. it looks like you call glInitNames, then glPushNames to push a bunch of names onto a list. when you’re drawing call glLoadName(index) just before drawing. to retrieve, use a ‘select buffer’, which seems to be associated with functions called glSelectBuffer() and a call to glRenderMode( GL_SELECTION ).

seems pretty straightforward, then. man, OpenGL is nice. i’d hate to try and do this with DirectX.

good luck

there has been some discussion of this before on the forums, search for “selection”

see this thread, for example:…-=selection

good luck !!