about pyopengl

shanjunxu xushanjun1212 at yahoo.com-dot-cn.no-spam.invalid
Mon Oct 3 08:46:18 EDT 2005


I am a chinese boy,my english is not good,so i don not know how to
tell you about my question,i hope you can understand what i say.
I like python, and now i using pyopengl to draw three-dimensional.
but how can i use mouse to control objects?such as selecting object.I
know a function( glSelectBuffer() ) can be used,In C language the
format is glSelectBuffer(size, buffer),  but in python the format is
glSelectBuffer(size), how can i get the "buffer" pointer?
The following is one section function of my codes:
def ProcessSelection(x,y):
    viewport=range(4)
    glSelectBuffer(64)
    viewport=glGetIntegerv(GL_VIEWPORT)
    glMatrixMode(GL_PROJECTION)
    glPushMatrix()
    glRenderMode(GL_SELECT)
    glLoadIdentity()
    gluPickMatrix(x, viewport[3]-y, 2, 2, viewport)
    gluPerspective(45.0, aspect, 0.1, 200.0)
    
    DrawButton()
    hits=glRenderMode(GL_RENDER)
 
    glMatrixMode(GL_PROJECTION)
    glPopMatrix()
    glMatrixMode(GL_MODELVIEW)

If you know how to do ,can you mail to me?thank you!
my e-mail is xushanjun1212 at yahoo.com.cn




More information about the Python-list mailing list