Skip to main content
gamedev.net
🔒 Locked

Picking Problem

Started by B4 May 27, 2002 at 2:01 PM 0 replies 150+ views
Original Post
B4
B4
I have been trying to use OpenGL picking with no luck. Below is the code that I use to try to make it work. If anyone would be so kind as to let me know the error, I would be very grateful. (pModel and pModel1 are MilkShape model objects) void Draw (void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); ProcessKeys(); camera.Update(); gluLookAt(camx, camy+3, camz+5, 0, 0, 0, 0, 1, 0); glRotatef( -camYaw + cx, 0.0, 1.0, 0.0 ); glTranslatef( -xpos, -ypos, -zpos ); glInitNames(); glPushName(0); terrain.Render(5.0f, 5.0f); glLoadName(100); pModel1->draw(xpos, terrain.GetHeight(xpos, zpos), zpos, camYaw); glLoadName(101); pModel->draw(xpos, terrain.GetHeight(xpos, zpos), zpos, camYaw); glColor4f(1.0, 1.0, 1.0, 1.0); glDrawText(40, 0 + FONT_HEIGHT, "FPS: %d", gfps); drawcursor(mousex, mousey); getfps(); }

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.