本文整理汇总了Python中panda3d.core.GeomVertexWriter.add_data3f方法的典型用法代码示例。如果您正苦于以下问题:Python GeomVertexWriter.add_data3f方法的具体用法?Python GeomVertexWriter.add_data3f怎么用?Python GeomVertexWriter.add_data3f使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.GeomVertexWriter
的用法示例。
在下文中一共展示了GeomVertexWriter.add_data3f方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _make_fullscreen_tri
# 需要导入模块: from panda3d.core import GeomVertexWriter [as 别名]
# 或者: from panda3d.core.GeomVertexWriter import add_data3f [as 别名]
def _make_fullscreen_tri(self):
""" Creates the oversized triangle used for rendering """
vformat = GeomVertexFormat.get_v3()
vdata = GeomVertexData("vertices", vformat, Geom.UH_static)
vdata.set_num_rows(3)
vwriter = GeomVertexWriter(vdata, "vertex")
vwriter.add_data3f(-1, 0, -1)
vwriter.add_data3f(3, 0, -1)
vwriter.add_data3f(-1, 0, 3)
gtris = GeomTriangles(Geom.UH_static)
gtris.add_next_vertices(3)
geom = Geom(vdata)
geom.add_primitive(gtris)
geom_node = GeomNode("gn")
geom_node.add_geom(geom)
geom_node.set_final(True)
geom_node.set_bounds(OmniBoundingVolume())
tri = NodePath(geom_node)
tri.set_depth_test(False)
tri.set_depth_write(False)
tri.set_attrib(TransparencyAttrib.make(TransparencyAttrib.M_none), 10000)
tri.set_color(Vec4(1))
tri.set_bin("unsorted", 10)
tri.reparent_to(self._node)
self._tri = tri
示例2: VertexDataWriter
# 需要导入模块: from panda3d.core import GeomVertexWriter [as 别名]
# 或者: from panda3d.core.GeomVertexWriter import add_data3f [as 别名]
class VertexDataWriter (object):
def __init__(self, vdata):
self.count = 0
self.vertex = GeomVertexWriter(vdata, 'vertex')
self.normal = GeomVertexWriter(vdata, 'normal')
self.color = GeomVertexWriter(vdata, 'color')
self.texcoord = GeomVertexWriter(vdata, 'texcoord')
def add_vertex(self, point, normal, color, texcoord):
self.vertex.add_data3f(point)
self.normal.add_data3f(normal)
self.color.add_data4f(*color)
self.texcoord.add_data2f(*texcoord)
self.count += 1