Hello there,
i’ve been trying out the rotating cube from examples, and wanted to modify it to spawn a lot more cubes removing rotation.
i did hit performance issue at 10000+ cubes (9fps)
After reading somewhere (don’t remember where), i used flattenStrong() on the NodePath who made it back to 60fps
But now i’m having performance issue when creating cubes, it take too long.
So i’m wondering what i did wrong and how i can boost the things up ? if it is possible
Thanks for any tips
and anyway thanks to have read me
...
def spawnCube():
mySnode=GeomNode('square')
mySnode.addGeomsFrom(snode)
cube=render.attachNewNode(mySnode)
cube.setTwoSided(True)
cube.setPos(random.randint(-50, 50),random.randint(-100, 0),random.randint(-50, 50))
cube.setTexture(L[random.randint(0, 10)])
...
class MyTapper(DirectObject):
...
//Key event to spawn 1000
def ACube(self):
count = 0
while (count < 1000):
spawnCube()
count = count + 1
render.flattenStrong()