Archived

This topic is now archived and is closed to further replies.

How do I create my own mesh file format?

This topic is 5652 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I really need help with this. I''m on the Create-my-own-mesh-file stage, and I don''t know how to start. so There is the question, yeah I know it''s whole but everything can help me. How do I cerate my own mesh file format? thanx.

Share this post


Link to post
Share on other sites
1) make a list of things you want in your file format and a list of criteria which are important to you (hierarchy info ?, extensibility ?, texture map names ?, file size for internet delivery ?... etc).

2) visit www.wotsit.org and check out the specifications of existing 3D file formats - learn what they have, see how they''ve done things, and work out why they''ve done it that way.

3) taking the best ideas from existing formats and your list from #1, go ahead and make your own format.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
After doing the steps Simon suggested above, design the format to the best of your ability. Then, try using it in a small game or smallish "real-world" application. If you're anything like me, the first attempt is never quite right (and you end up re-designing it) .

I think thats the only way to do it. For example, the file first format I had contained sub-meshes, with each sub-mesh having details of the material it uses. This got changed to having mesh and material sections, so 3 mesh section could reference the same material. I also had things stored similar to an obj file (with duplicate normals and tex co-ords only stored once etc to save space) but this meant parsing through all the indices and constructing unique vertices at run-time which sucked.. And so on...

Good luck!

T

[edited by - Tessellator on June 25, 2002 1:40:03 PM]

Share this post


Link to post
Share on other sites
Basically i would say do what is posted above. Creating your own mesh format will say alot about what you hope your mesh's to do. For example, do you want to be able to texturize a mesh with multiple textures .... if so.... then you need a way to group together and describe the different parts of your mesh. Most people dont need multiple textures for a single model so making this restriction isn't a big deal ... but it is something to consider. Having the ablity to map multiple textures to different parts of a mesh .... means.... you might have less textures over all..... since you can combine serveral textures together on a single mesh and thus can create a varity of different looks with only a small set of textures. For example, rather than just having a set number of skins for a given mesh. You could create several different textures for shoes.. for chests... and for helmets.... and let your player mix and match them as they like. But this also makes rendering of a model slower since you have to make more calls to your D3D to get the object rendered... as well as greater memory consumption for meshs ... as you now have to keep track of the textures for each section of the mesh... as well as where in the Vertex Buffer and Index Buffer these sections are and how to render them... etc ... anyways.... thats just one example of a question you'd need to answer and the different tradeoffs to consider

[edited by - Merick on June 25, 2002 1:57:24 PM]

Share this post


Link to post
Share on other sites
Lestat3D,

I deleted your question in the mesh drawing thread - it was out of place, especially since you''ve already posted this thread.

As for your question, I would do what Simon says (heh) and suggest looking closely at the ID3DXMesh objects to get an idea for mesh storage techniques. As for file formats, you might want to see how a format like .ms3d works - there''s lots of articles on it, and my newest book will also discuss using it in your own projects.


Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX

Share this post


Link to post
Share on other sites