I have a cube which I want to use as a room, so I have the following code:
Code: Select all
scene::IMeshSceneNode *room = smgr->addCubeSceneNode(15.0f, 0, IDFlag_IsSolid, core::vector3df(10,160,30), core::vector3df(0,0,0), core::vector3df(30, 30, 30));
smgr->getMeshManipulator()->flipSurfaces(room->getMesh());
room->setMaterialFlag(video::EMF_LIGHTING, true);
//room->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
//room->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
room->setMaterialTexture(0, driver->getTexture("media/texture.jpg"));
room->setTriangleSelector(smgr->createTriangleSelector( room->getMesh(), room ));
I have an animated light circling round the room, but it's not lighting these inside faces! So I created a duplicate cube but smaller, without the surface flip:
Code: Select all
scene::IMeshSceneNode *room2 = smgr->addCubeSceneNode(15.0f, 0, IDFlag_IsSolid, core::vector3df(10,160,30), core::vector3df(0,0,0), core::vector3df(3, 3, 3));
room2->setMaterialFlag(video::EMF_LIGHTING, true);
room2->setMaterialTexture(0, driver->getTexture("media/texture.jpg"));
room2->setTriangleSelector(smgr->createTriangleSelector( room2->getMesh(), room2 ));
So, for my first question: what have I missed?
Thanks in advance