本文整理汇总了Python中panda3d.core.Geom.decomposeInPlace方法的典型用法代码示例。如果您正苦于以下问题:Python Geom.decomposeInPlace方法的具体用法?Python Geom.decomposeInPlace怎么用?Python Geom.decomposeInPlace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.Geom
的用法示例。
在下文中一共展示了Geom.decomposeInPlace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeCylinder
# 需要导入模块: from panda3d.core import Geom [as 别名]
# 或者: from panda3d.core.Geom import decomposeInPlace [as 别名]
def makeCylinder(vdata, numVertices=40):
topCircleGeom = makeCircle(vdata, numVertices, Vec3(0, 0, 1))
bottomCircleGeom = makeCircle(vdata, numVertices, Vec3(0, 0, 0), -1)
body = GeomTristrips(Geom.UHStatic)
j = 40
i = 0
while i < numVertices + 1:
body.addVertex(i)
body.addVertex(j)
i += 1
if j == 40:
j = 2 * numVertices - 1
else:
j -= 1
body.addVertex(i)
body.addVertex(j)
j -= 1
i += 1
body.addVertex(numVertices - 1)
body.addVertex(0)
body.addVertex(numVertices)
body.closePrimitive()
cylinderGeom = Geom(vdata)
cylinderGeom.addPrimitive(body)
cylinderGeom.copyPrimitivesFrom(topCircleGeom)
cylinderGeom.copyPrimitivesFrom(bottomCircleGeom)
cylinderGeom.decomposeInPlace()
cylinderGeom.unifyInPlace()
return cylinderGeom