Code: Select all
SMaterial m;
m.Lighting = false;
m.MaterialType = EMT_SOLID;
m.Texture1 = driver->getTexture("monster.bmp");
S3DVertex Vertices[8];
Vertices[0] = video::S3DVertex(50,50,50, 1,1,0, video::SColor(255,255,255,255), 0, 0);
Vertices[1] = video::S3DVertex(50,50,-50, 1,0,0, video::SColor(255,255,255,255), 0, 0);
Vertices[2] = video::S3DVertex(50,-50,50, 0,1,1, video::SColor(255,255,255,255), 0, 1);
Vertices[3] = video::S3DVertex(50,-50,-50, 0,0,1, video::SColor(255,255,255,255), 0, 1);
Vertices[4] = video::S3DVertex(-50,50,50, 0,0,1, video::SColor(255,255,255,255), 1, 0);
Vertices[5] = video::S3DVertex(-50,50,-50, 0,0,1, video::SColor(255,255,255,255), 1, 0);
Vertices[6] = video::S3DVertex(-50,-50,50, 0,0,1, video::SColor(255,255,255,255), 1, 1);
Vertices[7] = video::S3DVertex(-50,-50,-50, 0,0,1, video::SColor(255,255,255,255), 1, 1);
u16 indices[] = {0,4,6, 0,6,2, 1,3,7, 1,7,5, 0,2,3, 0,3,1, 4,5,7, 4,7,6, 2,6,7, 2,7,3, 0,1,5, 0,5,4};
then in my render code:
driver->setMaterial(m);
driver->drawIndexedTriangleList(&Vertices[0], 8, &indices[0], 12);