Here's my code:
Code: Select all
IMesh* cylinder1 = createCylinderMesh(6, 10, 30, video::SColor(0, 255, 0, 0)); //red
IMesh* cylinder2 = createCylinderMesh(8, 20, 30, video::SColor(0, 0, 255, 0)); //green
IMesh* cylinder3 = createCylinderMesh(10, 30, 30, video::SColor(0, 0, 0, 255)); //blue
SAnimatedMesh *smesh = new SAnimatedMesh();
smesh->addMesh(cylinder1);
smesh->addMesh(cylinder2);
smesh->addMesh(cylinder3);
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(smesh);
node->setMaterialFlag(EMF_LIGHTING, false);
node->setAnimationSpeed(3);
http://irrlicht.sourceforge.net/phpBB2/ ... 890#180890
Here I'm creating 3 different cylinders, a small-red, a medium-green and a big-blue cylinder. Then populating a SAnimatedMesh with them (they're being correcly created, i've checked it separately).
My code will work, the animation will start playing, but the blue (the last) cylinder is missing.
It will show the blue cylinder (and the blue cylinder ONLY) if I use:
node->setFrameLoop(2, 2);
Otherwise, only the red and then the green cylinders will appear. What am I doing wrong?
PS. If I add the blue cylinder twice, like this:
Code: Select all
smesh->addMesh(cylinder1);
smesh->addMesh(cylinder2);
smesh->addMesh(cylinder3);
smesh->addMesh(cylinder3); //duplicated
Thanks.