本文整理汇总了Python中texture.Texture.unbind方法的典型用法代码示例。如果您正苦于以下问题:Python Texture.unbind方法的具体用法?Python Texture.unbind怎么用?Python Texture.unbind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类texture.Texture
的用法示例。
在下文中一共展示了Texture.unbind方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PointCloud
# 需要导入模块: from texture import Texture [as 别名]
# 或者: from texture.Texture import unbind [as 别名]
class PointCloud(GLArray):
def __init__(self, vertex_data=None, color_data=None):
GLArray.__init__(self, vertex_data, color_data)
self._sprite_texture = None
def sprite(self, filename):
print " -- initializing point sprite {}".format(filename)
self._sprite_texture = Texture(filename)
def _pre_draw(self):
GLArray._pre_draw(self)
if self._sprite_texture == None:
return
glDepthMask(GL_FALSE)
glEnable(GL_POINT_SMOOTH)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE)
self._sprite_texture.bind()
glTexEnvf(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE)
glEnable(GL_POINT_SPRITE)
glPointSize(15.0)
def _post_draw(self):
GLArray._post_draw(self)
if self._sprite_texture == None:
return
self._sprite_texture.unbind()
glDisable(GL_BLEND)
glDisable(GL_POINT_SPRITE)
def center(self):
try:
return self._center
except:
self._center = [0.0, 0.0, 0.0]
for i in range(3):
self._center[i] = sum(v[i] for v in self._vertex_data) / len(self._vertex_data)
return self._center