Download presentation
Presentation is loading. Please wait.
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)
9
When click, program knows which vertex is clicked.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.