how to output custom model to .mesh file

Problems building or running the engine, queries about how to use features etc.
Post Reply
az_anne
Gnoblar
Posts: 13
Joined: Tue Nov 29, 2016 1:37 am

how to output custom model to .mesh file

Post by az_anne »

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.
paroj
OGRE Team Member
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

Post by paroj »

see OgreXmlConverter source code.
az_anne
Gnoblar
Posts: 13
Joined: Tue Nov 29, 2016 1:37 am

Re: how to output custom model to .mesh file

Post by az_anne »

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.
hedphelym
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

Post by hedphelym »

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.
Post Reply