Presentation is loading. Please wait.

Presentation is loading. Please wait.

When click!! (void) glRenderMode (GL_SELECT); glInitNames(); glPushName(0); glMatrixMode (GL_PROJECTION); glPushMatrix (); glLoadIdentity (); gluPickMatrix.

Similar presentations


Presentation on theme: "When click!! (void) glRenderMode (GL_SELECT); glInitNames(); glPushName(0); glMatrixMode (GL_PROJECTION); glPushMatrix (); glLoadIdentity (); gluPickMatrix."— Presentation transcript:

1

2

3

4

5 When click!!

6 (void) glRenderMode (GL_SELECT); glInitNames(); glPushName(0); glMatrixMode (GL_PROJECTION); glPushMatrix (); glLoadIdentity (); gluPickMatrix ((GLdouble) x, (GLdouble) (viewport[3] - y), 20.0, 20.0, viewport); gluOrtho2D (0.0, 3.0, 0.0, 3.0); drawSquaresSelect(); glMatrixMode (GL_PROJECTION); glPopMatrix (); glFlush (); hits = glRenderMode (GL_RENDER); Define view volume Draw selection Buffer Draw your quad in this function again, and before drawing, use LoadName() and PushName() to assign a distinct name to the quad.

7 This point’s coordinate is near (0.5,0.25)

8

9 When click, program knows which vertex is clicked.

10

11

12

13

14


Download ppt "When click!! (void) glRenderMode (GL_SELECT); glInitNames(); glPushName(0); glMatrixMode (GL_PROJECTION); glPushMatrix (); glLoadIdentity (); gluPickMatrix."

Similar presentations


Ads by Google