about pyopengl

S

shanjunxu

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 (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,264
Messages
2,571,323
Members
48,007
Latest member
Elvis60357

Latest Threads

Top