Showing boundaries on Cube Scene Node
Posted: Sun Mar 27, 2011 1:24 pm
Is it possible to draw boundaries on the cubeSceneNode's I am using a chain of them to form a playing field and need one to be distinguished from the other.
Official forum of the Irrlicht Engine
https://irrlicht.sourceforge.io/forum/
Code: Select all
theCube->setDebugDataVisible(EDS_BBOX);
Code: Select all
void OutlineMesh(IAnimatedMeshSceneNode* mesh,float Width,unsigned int R,unsigned int G,unsigned int B)
{
SMaterial tmat[MATERIAL_MAX_TEXTURES],lmat;
lmat.DiffuseColor = SColor(255,R,G,B);
lmat.SpecularColor = SColor(255,R,G,B);
lmat.AmbientColor = SColor(255,R,G,B);
lmat.EmissiveColor = SColor(255,R,G,B);
lmat.BackfaceCulling = false;
lmat.FrontfaceCulling = true;
lmat.Lighting = true;
lmat.Thickness = Width;
lmat.Wireframe = true;
for(unsigned int i = 0;i<mesh->getMaterialCount();i++)
{
tmat[i] = mesh->getMaterial(i);
mesh->getMaterial(i) = lmat;
}
mesh->render();
for(unsigned int j = 0;j<mesh->getMaterialCount();j++)
mesh->getMaterial(j) = tmat[j];
}