How I can detect each object my mouse click.

I draw my 3D-Object by use these command

//////////////////////////////////////////////////
//class declaration
class CMyObject
{
double x,y,z;

public:
void Draw();
}
/////////////////////////////////////////////////
//Object declaration
CMyObject* MyShape;
////////////////////////////////////////////////
// Draw all objects
for(i=0;i<N;i++)
MyShape[i].Draw();
////////////////////////////////////////////////
void CMyObject: raw()
{
glBegin(GL_POLYGON);
glVertext(x1,y1,z1);
glVertext(x2,y2,z2);

glEnd();
}
///////////////////////////////////////////////
How I can detect each object by mouse clicked? In addition,my objects can be free rotated.So the plane may be contained x-z or y-z coordinate(not x-y). When I move mouse onto drawing area, I want to know the x,y and z coordinate .

Thanks,
amstel.

Hi,

Use this tut (the last one of the page) for your program :
http://www.gametutorials.com/Tutorials/OpenGL/OpenGL_Pg2.htm