Select a vertex from a 3D object

Hi,
After pressing the mouse button,i need that all the vertices
that are the most closest to that vertex to be painted ,lets say
with a red color.
I think that i shold use glRenderMode(GL_SELECT) function
but i don’t know how…
Thanks.

Nehe has a tutorial (number 32) that deals with picking.This should be what you’re after.