how to change the color of a cube surface

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
dujimache
Posts: 24
Joined: Mon Aug 03, 2009 3:22 am

how to change the color of a cube surface

Post by dujimache »

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);
        }
why what i see is still a black cube??
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: how to change the color of a cube surface

Post by randomMesh »

dujimache wrote:why what i see is still a black cube??
I see a white cube, a black sphere and two black cubes in that order from left to right.

Could you please rephrase your question?
"Whoops..."
Post Reply