Hi
I am completely new to Panda3d. I want to make a cube-voxel game where you can add new/remove cubes to the existing scene. a la minecraft.
i have managed to proceed with the procedual cube example, but then a thought hit me. maybe it will be much better to use a model of a cube, instead of generating a procedural one for my purposes.
when i first started out, i thought maybe it will be better to use procedural approach. maybe merging vertices and joining blocks will be easier.
now I am not so sure.
Can you tell me which approach is better?
can i take say, 6 egg models of a cube and merge them to make a larger cuboid which has only 4 vertices/6 faces?
There aren’t any performance gains. It’s just a question of which interface you prefer. If you’re really only talking about cubes, it probably doesn’t matter much at all. But using loaded models allows you more freedom to use an artist tool like Maya or Blender to construct more elaborate shapes in place of cubes, should you eventually go that route. Also, I personally find it easier to call loader.loadModel() than to make the dozen calls required to construct a cube by hand.
You can do anything with either approach. Of course the low-level egg loader is built on top of the procedural functions to construct geometry.
Be sure to make the clearModelNodes() and flattenStrong() calls I showed above. These are very important for performance when you are assembling many small models together.