I have searched forums and tried to read the Ogre 2.1 samples, but I still have no clue how to apply texture on mesh :(
Here what I've done so far.
- I use Easy Ogre Exporter to export the scene (actually I just need the model and texture). I got the following files:
- modelRoot.mesh
- modelRoot.skeleton
- model.material
- model.tga
Note: I also use OgreMeshTool_d.exe to upgrade the mesh from v1 to v2.
- I render this model into Ogre:
In the file resources2.cfg:
[Essential] Zip=../Data/DebugPack.zip I add the model files (4 files I got from Easy Ogre Exporter at step 1 above) into DebugPack.zip file.
And I use this code to add the model into the Ogre scene
void MeshHelper::CreateMesh(Ogre::String szFileName, Ogre::Vector3* scale) { /*Bring the mesh to scene*/ m_meshItem = m_sceneManager->createItem(szFileName, Ogre::ResourceGroupManager:: AUTODETECT_RESOURCE_GROUP_NAME, Ogre::SCENE_DYNAMIC); m_meshSceneNode = m_sceneManager->getRootSceneNode(Ogre::SCENE_DYNAMIC)-> createChildSceneNode(Ogre::SCENE_DYNAMIC); m_meshSceneNode->attachObject(m_meshItem); if (nullptr != scale) m_meshSceneNode->scale(scale->x, scale->y, scale->z); } ... meshHelper.CreateMesh("modelRoot.mesh", &meshScale); But I can only render the model without texture :(
Please help me to apply these texture into my model
- model.material
- model.tga
Thanks for reading :)