本文整理汇总了Python中opengltk.OpenGL.GL.glPointSize方法的典型用法代码示例。如果您正苦于以下问题:Python GL.glPointSize方法的具体用法?Python GL.glPointSize怎么用?Python GL.glPointSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opengltk.OpenGL.GL
的用法示例。
在下文中一共展示了GL.glPointSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Draw
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glPointSize [as 别名]
def Draw(self):
if __debug__:
if hasattr(DejaVu, 'functionName'): DejaVu.functionName()
GL.glEnable(GL.GL_AUTO_NORMAL)
GL.glEnable(GL.GL_NORMALIZE)
if self.theNurb is None:
self.theNurb = GLU.gluNewNurbsRenderer()
GLU.gluNurbsProperty(self.theNurb, GLU.GLU_SAMPLING_TOLERANCE,
25.0)
GLU.gluNurbsProperty(self.theNurb, GLU.GLU_DISPLAY_MODE,
GLU.GLU_OUTLINE_POLYGON)
GLU.gluNurbsCallback(self.theNurb, GLU.GLU_ERROR, self.nurbsError)
GLU.gluBeginSurface(self.theNurb)
_glulib.gluNurbsSurface( self.theNurb,
8, self.knots,
8, self.knots,
4*3,
3,
self.ctlpoints,
4, 4,
GL.GL_MAP2_VERTEX_3)
GLU.gluEndSurface(self.theNurb)
GL.glPointSize(5.0)
GL.glDisable(GL.GL_LIGHTING)
GL.glColor3f(1.0, 1.0, 0.0)
GL.glBegin(GL.GL_POINTS)
for i in range(4):
for j in range(4):
GL.glVertex3fv(self.ctlpoints[i][j])
GL.glEnd()
GL.glDisable(GL.GL_AUTO_NORMAL)
GL.glDisable(GL.GL_NORMALIZE)
示例2: _WidthAndStipple
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glPointSize [as 别名]
def _WidthAndStipple(self):
if __debug__:
if hasattr(DejaVu, 'functionName'): DejaVu.functionName()
"""Set the line or points width
"""
#print "_WidthAndStipple", self.stippleLines , self.inheritStippleLines , self
GL.glPointSize(self.getPointWidth())
GL.glLineWidth(self.getLineWidth())
if self.getStippleLines() in (True, 1):
GL.glEnable(GL.GL_LINE_STIPPLE)
ls = self.linestipple
GL.glLineStipple(ls.factor, ls.pattern)
else:
GL.glDisable(GL.GL_LINE_STIPPLE)
if self.getStipplePolygons() in (True, 1):
GL.glEnable(GL.GL_POLYGON_STIPPLE)
ps = self.polygonstipple
GL.glPolygonStipple(self.polygonstipple.pattern)
else:
GL.glDisable(GL.GL_POLYGON_STIPPLE)