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 ProcessSelectio n(x,y):
viewport=range( 4)
glSelectBuffer( 64)
viewport=glGetI ntegerv(GL_VIEW PORT)
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=glRenderMo de(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@y ahoo.com.cn
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 ProcessSelectio n(x,y):
viewport=range( 4)
glSelectBuffer( 64)
viewport=glGetI ntegerv(GL_VIEW PORT)
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=glRenderMo de(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@y ahoo.com.cn