Hi,
When create the model at first time, there are several steps.
Step 1: Get vertex information(position, normal, uv...) by reading obj file.
Step 2:Create Mesh object and set the HardwareVertexBuffer(vertexdata,indexdata)
Step 3:Load mesh
……
When the model has a lot of vertex information, the creation will take a lot of time.
So, I want to save the mesh to .mesh file. When I create the model again, can skip the above steps.
Has somebody an idea?
Thanks in advance.
how to output custom model to .mesh file
-
- Gnoblar
- Posts: 13
- Joined: Tue Nov 29, 2016 1:37 am
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: how to output custom model to .mesh file
see OgreXmlConverter source code.
-
- Gnoblar
- Posts: 13
- Joined: Tue Nov 29, 2016 1:37 am
Re: how to output custom model to .mesh file
Thank you for your answer. I know the OgreXmlConverter can converts between the binary and XML formats for .mesh and .skeleton. But I created a custom mesh model in running time. How can I save the running time mesh model to .mesh file in disk?Look forward to your reply.
-
- Gremlin
- Posts: 180
- Joined: Tue Nov 25, 2008 10:58 am
- Location: Kristiansand, Norway
- x 23
- Contact:
Re: how to output custom model to .mesh file
You need the 'Ogre::MeshSerializer' for this, if you search the forum you will find a lot of information about it and how you could use it.