Jump to content
  • Advertisement
Sign in to follow this  
asdqwe

creating your own 3d format

This topic is 3669 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

Advertisement
The workflow is equivalent to that of implementing an existing 3D format, plus the work of coming up with the format in the first place.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
The workflow is equivalent to that of implementing an existing 3D format, plus the work of coming up with the format in the first place.

Plus anyone having to use it needing to learn the idiosyncrasies of yet another format.

Share this post


Link to post
Share on other sites
I recommend starting with a xml format, they are nice and easy to work with and you will quickly get something up and running.

Share this post


Link to post
Share on other sites
What I'd really wanna know is how hard is it?
I've just finish a tic-tac-toe with bitmaps, in a Win32 app using GDI. At this level, am I ready to tackle this or is it above my head? Cause if it is, I'd better look into existing 3D formats instead of toiling to create my own...

Share this post


Link to post
Share on other sites
Well since this is a 3D file format, you have to know some basic 3D graphics concepts. Have you written any 3D applications? (not necessarily games)

Besides, what do you want the format to support?

And perhaps the most important question: Why do you want to create your own file format?

Share this post


Link to post
Share on other sites
Coming up with a 3d file format isn't that hard. For a simple game you'd only have to write a list of vertices, indices and maybe vertex normals.
Getting an existing 3d modeler to export something in your format may be harder. You would probably have to write an export plugin of some sorts depending on the application.

Share this post


Link to post
Share on other sites
I have to ask - why create your own at all?

Unless you have a really specific feature that you absolutely require and that no current format uses, I can't think of a good reason to try it. But there are so many formats, I find this to be rather unlikely.

If you are thinking that it will teach you something to write your own, I would disagree. It will teach you much more to compare two or three existing, popular varieties, and see what each decides is important/unimportant. Weigh the pros and cons of each, and try to think of places or situations where one might favor another.

If you are worried that the existing 3d formats are going to be to difficult to implement/understand or include too much extraneous data (which is what I was worried about when I started), I recommend either ignoring the data that you don't need or using a very simple format, like a .obj file. The .obj is text-based, so you could literally write one by hand with your favorite text editor (not a very complicated one, but you get the point).

If you have some other reason for wanting to do this, please share.

To answer your question, the difficulty really depends. When I wrote one (which is why I think that it is neither fun nor educational), all that I was interested in was knowing vertices and faces, that's it. That file format was, naturally, extremely simple. But then you realize that you really should include normal vertex data, and maybe some optimizations for triangle strips or fans. Oh, and texture data, including vertex mappings and materials. Then, of course, you decide that you ought to add the ability to utilize a NURBS-type surface. And three more types of materials. And bump-mapping. Now it should really be a binary file type, and not text-based. And it should be a scene-based format, rather than an object based format. Oh, and it needs to support multiple textures per object. Actually, how about multitexturing on a single face? And animation. Frame-based animation. Wait, no, skeleton based animation. Or maybe I should fuse the two into a new type of animation that uses non-uniform B-spline interpolation to create more realistic movements. Etc, etc. This is an exaggeration, but you can see how designing your own format gets out of hand really fast. In fact, a significant amount of research is required just to know what sort of data about a 3d model you might want in your file format - let alone how to implement that data (or how to implement them well).

I guess that your question is too vague for a definite answer. My best guess would be that designing a 3d format is hard - very hard. Your best bet would be to first have a complete understanding of all of the types of features that you would want to implement. This is no small project by any means. Only once you have finalized a list of features that balances size with usability should you start thinking about the best way to organize this data. Then, you have to write either an exporter for your favorite modeling program which allows you to get files in your new format, or you need to write a converter that chops someone else's format into your own. Then (or probably concurrently) you write the interpreter that loads it up in your game.

Let me know why exactly you want to design your own format, I'm very curious.

Cheers,
Brian

Share this post


Link to post
Share on other sites
"Why I want to create my own format when there are dozens out there?"

I've decided to begin 3D game programming with a C++ game engine: Irrlicht. Up to now I've had no problem displaying with it static meshes (in 3DS format). And now I want to display animated meshes. But Irrlicht supports animation only in these formats: .md2(Quake 2), .md3(Quake 3), .ms3d (MilkShape 3D) or .x (DirectX). So the choices are already down to 4 formats. Add to that that md2 & md3 only support a limited pallette and only no-bones animation (you have to move individual vertices & faces, it's like animation prehistory).
As for .ms3d, I don't know how to get an animatiom from 3DS Max 6 (what I use) to this format.
And as for .x, I've read that Max-to-.x converters were severely lacking.

So the only certain things are:
1) I want to use Max to create animations
2) I want to end up with a .ms3d or .x file
3) I don't know how to solve 2)
3a) Creating a new 3D file format seems a bit overhead:)

Maybe you can help me?

Share this post


Link to post
Share on other sites
Quote:
Original post by asdqwe
What I'd really wanna know is how hard is it?
I've just finish a tic-tac-toe with bitmaps, in a Win32 app using GDI. At this level, am I ready to tackle this or is it above my head? Cause if it is, I'd better look into existing 3D formats instead of toiling to create my own...


IMO, you really would do better to go a lot further in the direction of "make more complicated games" before venturing towards "make games in a more complicated (but pretty) way".

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!