how to use Python-Ogre as a mesh loader?


07-04-2007 17:31:33

I would like to use Python-Ogre in order to load some objects from *.mesh files. I need the information about vertices, normals etc. but I don't need anything else like Python-Ogre rendering engine etc. I want to use Python-Ogre only as a loader for my little OpenGL app. I've tried to create Root, SceneManager and use SceneManager::createEntity but without success. I heard also that it is possible to load a mesh from file using MeshSerializer (are there any examples?). Is there a way to use Python-Ogre only for such a purpose like loading objects? If so, what is the best way to do it?

best regards


07-04-2007 17:49:58

First I am going to try and convince you not use Python-Ogre (or Ogre at all for that manner) as a convenient way to load mesh data into your custom application. This would only be a good idea if you already had a large custom application and wished to leverage the support Ogre mesh format has with modeling tools.

If you are just starting a new app you will probably be able to accomplish more if you learn the Ogre API and use it to create effects and manage your scene for you. It will also be quite a bit faster since the majority of the work will be done in C++ for you. This will turn into less areas of your game that might need recoded in C/C++ to get a speed boost.

I have not worked with the MeshSerializer my self but the docs are pretty clear. You want to use the importMesh function. Then go through the SubMesh's of the Mesh you told it to load into and access the vertex and index data. I don't know if these have been wrapped properly (these are raw int/float arrays).