PDA

View Full Version : where is this wrong?



Helen
01-15-2002, 05:24 PM
The program is here.

void CTopView::OnLButtonDown(UINT nFlags, CPoint point)
{
PickPoint(point.x,point.y);
}

GLuint CTopView::PickPoint(int x,int y)
{

GLuint selectBuf[BUFSIZE];
GLint hits;
GLint viewport[4];

glGetIntegerv(GL_VIEWPORT, viewport);

glSelectBuffer (BUFSIZE, selectBuf);
(void) glRenderMode (GL_SELECT);

glInitNames();
glPushName(-1);

glMatrixMode (GL_PROJECTION);
glPushMatrix ();
glLoadIdentity ();
gluPickMatrix((GLdouble)x, (GLdouble) (viewport[3] - y), 18, 18, viewport);
gluPerspective(35.0, (GLfloat)viewport[2]/(GLfloat)viewport[3], 1.0f, 5000.0f);

myDrawScene(GL_SELECT);

glPopMatrix ();
glFlush ();

hits = glRenderMode(GL_RENDER);

}

anyone can tell me where this is wrong.

pallindo
01-15-2002, 06:35 PM
Could you please tell us what exactly doesnt' work like it should?

Does it draw polygons in purple, when they should be orange? Or does it dial into your local Krogers and get 1/2 gal skim when you want 2%?

Some hints, please.