本文整理汇总了Python中opengltk.OpenGL.GL.glFlush方法的典型用法代码示例。如果您正苦于以下问题:Python GL.glFlush方法的具体用法?Python GL.glFlush怎么用?Python GL.glFlush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opengltk.OpenGL.GL
的用法示例。
在下文中一共展示了GL.glFlush方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: display
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glFlush [as 别名]
def display(self):
GL.glClearColor( 0.0, 0.0, 0.0, 0.0)
GL.glClear( GL.GL_COLOR_BUFFER_BIT)
GL.glColor3f( 1.0,1.0,0.0)
self.x = self.x + self.move_x
self.y = self.y + self.move_y
self.age = self.age + 1
which = Numeric.greater( self.age, MAX_AGE)
self.x = Numeric.choose( which, (self.x, RandomArray.random( NUMDOTS)))
selfy = Numeric.choose( which, (self.y, RandomArray.random( NUMDOTS)))
self.age = Numeric.choose( which, (self.age, 0))
self.x = Numeric.choose( Numeric.greater( self.x, 1.0), (self.x, self.x - 1.0))
self.y = Numeric.choose( Numeric.greater( self.y, 1.0), (self.y, self.y - 1.0))
x2 = RandomArray.random( NUMDOTS2)
y2 = RandomArray.random( NUMDOTS2)
v = Numeric.concatenate(
(Numeric.transpose( Numeric.array( [self.x, self.y])),
Numeric.transpose( Numeric.array( [self.x - 0.005, self.y + 0.005])),
Numeric.transpose( Numeric.array( [self.x + 0.005, self.y - 0.005])),
Numeric.transpose( Numeric.array( [x2, y2]))))
#from opengltk.util import GLdouble
#av = bufarray.readArray( v, GLdouble)
#GL.glVertexPointer( 2, av)
GL.glVertexPointer( 2, v)
GL.glEnableClientState( GL.GL_VERTEX_ARRAY)
#glplus.DrawArrays( GL.POINTS, len( av))
from opengltk import glplus
glplus.DrawArrays( GL.GL_POINTS, len( v))
#GL.glDisableClientState( GL.VERTEX_ARRAY)
GL.glFlush()
GLUT.glutSwapBuffers()
示例2: display
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glFlush [as 别名]
def display(self):
GL.glClear( GL.GL_COLOR_BUFFER_BIT)
GL.glColor3f( 1.0, 1.0, 1.0)
GL.glLoadIdentity() # clear the matrix
# viewing transformation
GLU.gluLookAt( 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
GL.glScalef( 1.0, 2.0, 1.0) # modeling transformation
GLUT.glutWireCube( 1.0)
GL.glFlush()
示例3: tkRedraw
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glFlush [as 别名]
def tkRedraw(self, *dummy):
#if not self.winfo_ismapped(): return
self.update_idletasks()
self.tk.call(self._w, 'makecurrent')
self.initProjection()
GL.glPushMatrix()
self.redraw()
GL.glFlush()
GL.glPopMatrix()
self.tk.call(self._w, 'swapbuffers')
示例4: display
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glFlush [as 别名]
def display(self):
GL.glClear( GL.GL_COLOR_BUFFER_BIT)
# select white for all lines
GL.glColor3f( 1.0, 1.0, 1.0)
# in 1st row, 3 lines, each with a different stipple
GL.glEnable( GL.GL_LINE_STIPPLE)
GL.glLineStipple( 1, 0x0101) # dotted
self.drawOneLine( 50.0, 125.0, 150.0, 125.0)
GL.glLineStipple( 1, 0x00FF) # dashed
self.drawOneLine( 150.0, 125.0, 250.0, 125.0);
GL.glLineStipple( 1, 0x1C47) # dash/dot/dash
self.drawOneLine( 250.0, 125.0, 350.0, 125.0)
# in 2nd row, 3 wide lines, each with different stipple
GL.glLineWidth( 5.0)
GL.glLineStipple( 1, 0x0101) # dotted
self.drawOneLine( 50.0, 100.0, 150.0, 100.0)
GL.glLineStipple( 1, 0x00FF) # dashed
self.drawOneLine( 150.0, 100.0, 250.0, 100.0)
GL.glLineStipple( 1, 0x1C47) # dash/dot/dash
self.drawOneLine( 250.0, 100.0, 350.0, 100.0)
GL.glLineWidth( 1.0)
# in 3rd row, 6 lines, with dash/dot/dash stipple
# as part of a single connected line strip
GL.glLineStipple( 1, 0x1C47) # dash/dot/dash
GL.glBegin( GL.GL_LINE_STRIP)
try:
for i in range( 0, 7):
GL.glVertex2f( 50.0 + (i * 50.0), 75.0)
finally:
GL.glEnd()
# in 4th row, 6 independent lines with same stipple */
for i in range( 0, 6):
self.drawOneLine( 50.0 + (i * 50.0), 50.0, 50.0 + ((i+1) * 50.0), 50.0)
# in 5th row, 1 line, with dash/dot/dash stipple
# and a stipple repeat factor of 5
GL.glLineStipple( 5, 0x1C47) # dash/dot/dash
self.drawOneLine( 50.0, 25.0, 350.0, 25.0)
GL.glDisable( GL.GL_LINE_STIPPLE)
GL.glFlush()
示例5: tkRedraw
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glFlush [as 别名]
def tkRedraw(self, *dummy):
"""Cause the opengl widget to redraw itself.
guillaume: call the preparation of the opengl matrices for drawing the widget
then draw the widget
"""
if __debug__:
if hasattr(DejaVu, 'functionName'): DejaVu.functionName()
#if not self.winfo_ismapped(): return
self.update_idletasks()
self.tk.call(self._w, 'makecurrent')
self.initProjection()
GL.glPushMatrix()
self.redraw()
GL.glFlush()
GL.glPopMatrix()
self.tk.call(self._w, 'swapbuffers')
示例6: display
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glFlush [as 别名]
def display(self):
GL.glClear(GL.GL_COLOR_BUFFER_BIT)
self.triangle()
GL.glFlush()