Is it possible to call the global render from a basic class that doesn’t inherit from ShowBase or DirectObject?
I have some of the following code that I’m trying to render from
class Chunk(object):
'''
Basic Chunk
'''
chunkSizeX=16
chunkSizeY=16
chunkSizeZ=16
def __init__(self, params):
'''
Constructor
'''
self.blkArray = np.zeros([self.chunkSizeX,self.chunkSizeY,self.chunkSizeZ],dtype = int)
def render(self):
self.mesh = CubeModelGenerator.MeshGenerator()
self.mesh.makeFrontFace(0, 0, 0, [52,160,46,0])
self.mesh.makeBackFace(0, 0, 0, [52,160,46,0])
self.mesh.makeRightFace(0, 0, 0, [52,160,46,0])
self.mesh.makeLeftFace(0, 0, 0, [52,160,46,0])
self.mesh.makeTopFace(0, 0, 0, [52,160,46,0])
self.mesh.makeBottomFace(0, 0, 0, [52,160,46,0])
cube = render.attachNewNode(self.mesh.getGeomNode())
def Update(self):
pass