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() #print body cylinderGeom=Geom(vdata) cylinderGeom.addPrimitive(body) cylinderGeom.copyPrimitivesFrom(topCircleGeom) cylinderGeom.copyPrimitivesFrom(bottomCircleGeom) cylinderGeom.decomposeInPlace() cylinderGeom.unifyInPlace() return cylinderGeom