As stated in the topic, i have a question related to the TestSceneNode.
In my code i added some TestNodes within a for loop. The Problem is, that i can only access the first (or last?) SceneNode. For test purposes i tried to let all cubes rotate, but only one does. The other strange thing is that i can't count the generated cubes via getMeshBufferCount, so i needed a workaround.
My Question: Is it that only one TestSceneNode is added, no matter how often i create them, or is there a problem with my code?
Code: Select all
int steps = 500;
ITexture* tex = core->getVideo()->getTexture("media/stone.jpg");
ISceneNodeAnimator* anim = core->getSceneMgr()->createRotationAnimator(vector3df(0,.5,0));
for (int x = 0; x < 1000; x+=steps)
{
for (int y = 0; y < 1000; y+=steps)
{
for (int z = 0; z < 1000; z+=steps)
{
i++;
core->getSceneMgr()->addTestSceneNode(15,0,i,vector3df(x,y,z));
core->getSceneMgr()->getSceneNodeFromId(i)->setMaterialTexture(0,tex); core->getSceneMgr()->getSceneNodeFromId(i)->addAnimator(anim);
}
}
}
cout << "generated " << i << " Cubes" << endl;