Hi juanjpro,
I have purposely not put on the diffuse texture, so that you can just see the normalmap.
All the detail you see on the handgrenade is done by the normalmap.
I have a video of the wireframe that I made to show off the normalmap on vimeo ages ago.
http://vimeo.com/38296780
I have a meshloading class
and I call the code with
Code: Select all
LoadMesh grenade;
grenade.loadPiece(smgr,driver,L"data/grenade/grenade.obj");
grenade.nodePosition(0,79.3f,22);
and here is the function in my class which loads the mesh, sets up the mesh node, and creates the camera node
Code: Select all
void LoadMesh::loadPiece(ISceneManager* smgr,IVideoDriver* driver,const wchar_t* modelname)
{
mesh = smgr->getMesh(modelname);
node = smgr->addMeshSceneNode(mesh);
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, true);
node->setPosition(core::vector3df(0,0,0));
node->addShadowVolumeSceneNode();
camera = smgr->addCameraSceneNode(node,vector3df(0, 10, 5));
camera->bindTargetAndRotation(true);
camera->setTarget(node->getPosition());
}
}
void LoadMesh::nodePosition(float x,float y,float z)
{
node->setPosition(vector3df(x,y,z));
}
Please ignore the camera code. That is there because I will be adding a camera to every piece so that when it is moving you will get a closeup of the piece in action.
I will use an array of the class later when I get all the pieces in the game.
I didn't think you wanted all my code, but this is the important code that loads my mesh.