Code: Select all
scene::ISceneNode *cube1 = smgr->addCubeSceneNode(10.0f,0,1,core::vector3df(-50,0,0));
scene::ISceneNode *cube2 = smgr->addCubeSceneNode(10.0f,0,2,core::vector3df(0,0,0));
scene::ISceneNode *cube3 = smgr->addCubeSceneNode(10.0f,0,3,core::vector3df(50,0,0));
scene::ISceneNode *sphere = smgr->addSphereSceneNode(10.0f,16,cube1,4,core::vector3df(30,0,0));
scene::ISceneNodeAnimator *anim1 = smgr->createRotationAnimator(core::vector3df(0.3,0,0));
scene::ISceneNodeAnimator *anim2 = smgr->createRotationAnimator(core::vector3df(0.3,0,0));
scene::ISceneNodeAnimator *anim3 = smgr->createRotationAnimator(core::vector3df(0.3,0,0));
cube1->addAnimator(anim1);
cube2->addAnimator(anim2);
cube3->addAnimator(anim3);
anim1->drop();
anim2->drop();
anim3->drop();
cube1->setMaterialFlag(video::EMF_LIGHTING,false);
for (int i=0; i< cube1->getMaterialCount();i ++)
{
cube1->getMaterial(i).DiffuseColor = video::SColor(255,255,0,0);
}