that means animated parallax ,normal ...
Code: Select all
void ConvertToAnimatedWithTangents(scene::IAnimatedMeshSceneNode *node,scene::ISceneManager* smgr)
{
scene::IAnimatedMesh* Mesh = node->getMesh();
scene::SAnimatedMesh* am = new scene::SAnimatedMesh();
for(int i=0;i<=Mesh->getFrameCount();i++)
{
scene::IMesh* tangentMesh =smgr->getMeshManipulator()->createMeshWithTangents(Mesh->getMesh(i));
am->addMesh(tangentMesh);
}
//Mesh->drop();
node->setMesh(am);
am->drop();
}
Code: Select all
scene::IAnimatedMesh* mesh =smgr->getMesh("dwarf.x");;
if (mesh)
{scene::IAnimatedMeshSceneNode *node = smgr->addAnimatedMeshSceneNode(mesh);
ConvertToAnimatedWithTangents(node,smgr);
// load heightmap, create normal map from it and set it
video::ITexture* NormalMap = driver->getTexture("rockwall_height.bmp");
if (NormalMap)
{
driver->makeNormalMapTexture(NormalMap, 9.0f);
node->setMaterialTexture(0, driver->getTexture("rockwall.jpg"));
node->setMaterialTexture(1, NormalMap);
node->setMaterialType(video::EMT_PARALLAX_MAP_SOLID);
node->getMaterial(0).MaterialTypeParam = 0.035f;
}
}