PDA

View Full Version : Problem to pick a line and arc object in opengl



kundi ropte
04-14-2011, 10:49 PM
glMatrixMode (GL_PROJECTION);
glPushMatrix ();
glLoadIdentity ();
gluPickMatrix((GLdouble) point.x, (GLdouble)(viewport[3] - point.y), 12.0, 12.0, viewport);
gluPerspective(30.0,gldAspect,1.0,20.0);
glMatrixMode(GL_MODELVIEW);
PaintScreen(GL_SELECT);
glPopMatrix ();
glFlush ();

hits = glRenderMode (GL_RENDER);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0,0,glnWidth,glnHeight);
gluPerspective(30.0,gldAspect,1.0,20.0);

I am using this code to pick line and arc objects from opengl document but it is unable to get hit record in select buffer. Please help me regarding this issue.