本文整理汇总了Python中panda3d.core.GeomNode.encodeToBamStream方法的典型用法代码示例。如果您正苦于以下问题:Python GeomNode.encodeToBamStream方法的具体用法?Python GeomNode.encodeToBamStream怎么用?Python GeomNode.encodeToBamStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.GeomNode
的用法示例。
在下文中一共展示了GeomNode.encodeToBamStream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _makeGeom
# 需要导入模块: from panda3d.core import GeomNode [as 别名]
# 或者: from panda3d.core.GeomNode import encodeToBamStream [as 别名]
def _makeGeom(array,ctup,i,pipe, geomType=GeomPoints): #XXX testing multiple Geom version ... for perf seems like it will be super slow
#SUUUPER slow TONS of draw calls
#wwwayyy better to make a bunch of geoms ahead of time...
""" multiprocessing capable geometery maker """
fmt = GeomVertexFormat.getV3c4()
cloudNode = GeomNode('bin %s selectable'%(i))
for point in array:
vertexData = GeomVertexData('poitn', fmt, Geom.UHStatic)
GeomVertexWriter(vertexData, 'vertex').addData3f(*point)
GeomVertexWriter(vertexData, 'color').addData4f(*ctup)
#verts.addData3f(*point)
#color.addData4f(*ctup)
points = geomType(Geom.UHStatic)
points.addVertex(0)
points.closePrimitive()
cloudGeom = Geom(vertexData)
cloudGeom.addPrimitive(points)
cloudNode.addGeom(cloudGeom) #TODO figure out if it is faster to add and subtract Geoms from geom nodes...
#output[i] = cloudNode
#print('ping',{i:cloudNode})
#pipe.send((i,))
#out = q.get()
#print('pong',out)
#q.put(out)
if pipe == None:
return (cloudNode)
pipe.send(cloudNode.encodeToBamStream()) #FIXME make this return a pointer NOPE
示例2: makeGeom
# 需要导入模块: from panda3d.core import GeomNode [as 别名]
# 或者: from panda3d.core.GeomNode import encodeToBamStream [as 别名]
def makeGeom(index_counter, array,ctup,i,pipe, geomType=GeomPoints):
""" multiprocessing capable geometery maker """
#man = indexMan(('127.0.0.1',5000), authkey='none')
#man.connect()
#index = man.index()
index = {}
fmt = GeomVertexFormat.getV3c4()
vertexData = GeomVertexData('points', fmt, Geom.UHDynamic) #FIXME use the index for these too? with setPythonTag, will have to 'reserve' some
#vertexData.setPythonTag('uid',index.reserve()) #maybe we don't need this? the geom should have it all?
cloudGeom = Geom(vertexData)
#cloudGeom.setPythonTag('uid',index.reserve())
cloudNode = GeomNode('bin %s selectable'%(i))
uid = next(index_counter)
index[uid] = None
cloudNode.setPythonTag('uid',uid) #FIXME we return cloudnode elsewhere... maybe on the other end we can set the uid in the index properly?
points = array
verts = GeomVertexWriter(vertexData, 'vertex')
color = GeomVertexWriter(vertexData, 'color')
for point in points:
index[next(index_counter)]=[point,cloudNode.getPythonTag('uid'),None] #FIXME we're gonna need a decode on the other end?
verts.addData3f(*point)
color.addData4f(*ctup)
points = geomType(Geom.UHDynamic)
points.addConsecutiveVertices(0,len(array))
points.closePrimitive()
cloudGeom.addPrimitive(points)
cloudNode.addGeom(cloudGeom) #TODO figure out if it is faster to add and subtract Geoms from geom nodes...
#output[i] = cloudNode
#print('ping',{i:cloudNode})
#pipe.send((i,))
#out = q.get()
#print('pong',out)
#q.put(out)
if pipe == None:
return cloudNode, index
pipe.send(cloudNode.encodeToBamStream()) #FIXME make this return a pointer NOPE
pipe.send(index) #FIXME make this return a pointer NOPE