本文整理匯總了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)