Id like to make a game where the levels are entirely made up of cubes, something like the game http://minecraft.net/. The levels will be randomly generated and i need to be able to add and remove cubes during runtime (destructible/constructable terrain).
Ive tried simply adding a separate scene node for each of edit: 200 x 200 = 40,000 not 2000, cubes as a test but obviously take a huge performance hit. I guess im just looking for some advice on how to get started and as im new to 3d programming i don't even know what to search for.
This is how i've tried adding nodes:
Code: Select all
for(int z=0;z<200;z++)
{
for(int x=0;x<200;x++)
{
scene::ISceneNode * node = smgr->addCubeSceneNode();
if (node)
{
node->setPosition(core::vector3df(x*10,0,z*10));
node->setMaterialTexture(0, driver->getTexture("../media/t351sml.jpg"));
node->setMaterialFlag(video::EMF_LIGHTING, false);
}
}
}