Block Building Program - How to proceed

Hello everyone!

I am working on a university project, and I need to build a tool for which I think Panda is very well suited. I’m hoping you guys can point me in the right direction.

I need to code a tool where people can create objects out of blocks about 1x1x1 meter. i.e., they walk around a flat plane (it can be a grey floor for all I care) and click, and a cube appears. They click on top of that cube, and one appears on top of it, etc.

I will then need to export all these blocks to an XML file, so I can reconstruct it in another, non-graphical program (this tool is only to make constructing these objects easier).

I know very little of 3D coding, as I am mainly a server/db guy.

For this tool, I am thinking of using CardMaker to create the ground plane, and then procedurally generating the cubes like in the demo. If I understand what I have read so far, though, this could become problematical, as I need to have the capacity to support an object of potentially thousands of cubes.

Is CardMaker the right tool to use for this? Can anyone give me some suggestions on what to look at in Panda to do this project?


CardMaker is fine, and dynamically generated cubes are fine; though it might be easier to pre-generate the ground plane and the cube model and have them standing by as egg files that you load when needed. Your call on that one.

It’s true that you will have issues with too many individual pieces unless you occasionally flatten them together into a single object. You can use root.flattenStrong() for this. You will have to decide how often and how aggressively you wish to group objects together. You can’t reverse a flattenStrong() operation, but if you need to remove blocks you can maintain a separate copy of all of the individual blocks and just use the flattened copy for rendering, then occasionally reconstruct the flattened copy as needed.