I've changed the standard quake example to use my model and it looks quite nice but Now I want to add extra components (Houses, trees, etc.)
I'm using this code from the tutorial but it doesn't work... probably because I'm using AnimatedMesh and it is not an animated mesh... it doesn't load textures but they are where they should be...
Code: Select all
//add Flat
scene::IAnimatedMesh* flatMesh = smgr->getMesh("../../media/Map/Story/FlatStory.b3d");
scene::ISceneNode* flatNode = 0;
if (flatMesh) flatNode = smgr->addOctTreeSceneNode(flatMesh->getMesh(0));
flatNode->setScale(core::vector3df(.5,.5,.5));
scene::ITriangleSelector* selector2 = 0;
if (flatNode){
flatNode->setPosition(core::vector3df(0,-200,0));
selector2 = smgr->createOctTreeTriangleSelector(flatMesh->getMesh(0), flatNode, 128);
flatNode->setTriangleSelector(selector2);}
Which is the shortest code to add a mesh (textured) to my scene (the textures are defined in the b3d file and in the same dir) and which is the shortest code to add all new meshes to my triangleselector?