本文整理汇总了Python中pandac.PandaModules.GeomVertexWriter.setData3f方法的典型用法代码示例。如果您正苦于以下问题:Python GeomVertexWriter.setData3f方法的具体用法?Python GeomVertexWriter.setData3f怎么用?Python GeomVertexWriter.setData3f使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandac.PandaModules.GeomVertexWriter
的用法示例。
在下文中一共展示了GeomVertexWriter.setData3f方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _set_z_on_shaft
# 需要导入模块: from pandac.PandaModules import GeomVertexWriter [as 别名]
# 或者: from pandac.PandaModules.GeomVertexWriter import setData3f [as 别名]
def _set_z_on_shaft(self, z):
for vdata in self.shaft_vdata:
reader = GeomVertexReader(vdata, 'vertex')
writer = GeomVertexWriter(vdata, 'vertex')
while not reader.isAtEnd():
v = reader.getData3f()
if v[2] > 0:
writer.setData3f(v[0],v[1],z)
else:
writer.setData3f(v) # I have to call the writer setData method in any case
示例2: set_bar_height
# 需要导入模块: from pandac.PandaModules import GeomVertexWriter [as 别名]
# 或者: from pandac.PandaModules.GeomVertexWriter import setData3f [as 别名]
def set_bar_height(self, height):
""" Sets the height of the bar to the given value. The given height should be between 0 and 1. """
reader = GeomVertexReader(self.bar_vdata, 'vertex')
writer = GeomVertexWriter(self.bar_vdata, 'vertex')
while not reader.isAtEnd():
v = reader.getData3f()
if v[2] > 0:
writer.setData3f(v[0],v[1],height)
else:
writer.setData3f(v) # I have to call the writer setData method in any case
示例3: scale_vertices
# 需要导入模块: from pandac.PandaModules import GeomVertexWriter [as 别名]
# 或者: from pandac.PandaModules.GeomVertexWriter import setData3f [as 别名]
def scale_vertices(self, multiplier):
"""
Scale the working vertices as the given multiplier to the original
vertices.
@type multiplier: number
@param multiplier: Coefficient to apply to original vertices.
"""
for i,geom in self.__get_geoms():
orig_vdata = self.orig_vertices[i]
working_vdata = self.working_vertices[i]
reader = GeomVertexReader(orig_vdata, 'vertex')
writer = GeomVertexWriter(working_vdata, 'vertex')
while not reader.isAtEnd():
data = reader.getData3f()
writer.setData3f(data[0] * multiplier,
data[1] * multiplier,
data[2] * multiplier)
示例4: _set_threshold
# 需要导入模块: from pandac.PandaModules import GeomVertexWriter [as 别名]
# 或者: from pandac.PandaModules.GeomVertexWriter import setData3f [as 别名]
def _set_threshold(self, vdata, t_value):
reader = GeomVertexReader(vdata, 'vertex')
writer = GeomVertexWriter(vdata, 'vertex')
while not reader.isAtEnd():
v = reader.getData3f()
writer.setData3f(v[0],v[1],t_value+self.padding)