Optimization idea
I was rendering a very large Deep Space 9 model, and it was hanging. I ended up optimizing your rendering script's Minecraft class as follows, and inserting a call to draw() after all the drawing was done. This puts all the block positions in a dictionary, which avoids the load on Minecraft from drawing multiple blocks in the same position.
def __init__(self, mc):
self.mc = mc
self.data = {}
def draw(self):
for key in self.data:
d = self.data[key]
mc.setBlock(key[0],key[1],key[2],d[0],d[1])
# draw point
def drawPoint3d(self, x, y, z, blockType, blockData=None):
#self.mc.setBlock(x,y,z,blockType,blockData)
self.data[int(x),int(y),int(z)] = [blockType,blockData]
#print "x = " + str(x) + ", y = " + str(y) + ", z = " + str(z)
It looks like a sensible change to pre-process the blocks which need changing before changing them.
Any chance you could send me a pull request?
Sorry: I don't know enough about git to know what exactly that means.
Its pretty simple. If you fork my repository, make your changes to that repository you can then send me a request which says "pull this change - I think it should go into the main position". Or I could pull the change from your repository.
OK, done that, both for this issue and for my other one. My repository is https://github.com/arpruss/minecraft-renderObj