• Advertisement

Archived

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

Reccomended model format?

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

I know in Direct X there''s lots of support for the .x format of models.. Is there anything like this for OpenGL?

Share this post


Link to post
Share on other sites
Advertisement
There is no native model format in OpenGL but there are many tutorials online that can teach you how to use common model formats in OpenGL:

http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg4.htm

Share this post


Link to post
Share on other sites
I''m at a similar point. I need to know a good model format for OpenGL that supports not only character loading, but models as well. I''m just guessing, but .3ds is bloated(?), and .md3 is only for characters(?). Is there another format that is used in games?

Share this post


Link to post
Share on other sites
3ds is god awful. You need a recursive loader to read them in. 3ds is hell to start out with. I suggest writing a milkshape file loader to begin your journey into the murky realm of 3d file loading. Milkshape files are simple and lean. Nehe''s site has a good tutorial on loading them.

Share this post


Link to post
Share on other sites
AFAICT, .X has a very complete feature set and can be very easily exported by most model packages. There''s no reason why it can''t be used for OpenGL... but I can''t find any tutorials on how to load them. Anyone?

[teamonkey]

Share this post


Link to post
Share on other sites
didnt the dx sdk have a converter and an option to output plain text x-files? might at least be enough to start out (of course .ase would be the same and if youre lucky your favorite modelling tool will let you add an export plugin to anything you cook up)

Share this post


Link to post
Share on other sites
For your first file format. I recommend the OBJ file format. It''s a bit dated, and I don''t think that it does animation. However, it is text based, and relatively simple to understand. Use that as a start point, then jump in to some of the other ones.

For OpenGL (and DirectX) it doesn''t really matter what file format you use. What matters is your loader for your program. It needs to take the data in the file''s format and then put it in your programs data structures so that when you begin rendering, your program knows what to draw. There are a bunch of good tutorials on mesh file formats at:

GameTutorials.com


Cheers,

Bob




----------------------------------
Halfway down the trail to hell...

Share this post


Link to post
Share on other sites
I researched the 3ds file format, and came up with a basic loader for it. It works good and renders well, so is there any reason not to stick with it now? I understand it really well, and can work with it, but now I don''t see a reason not to stick with it.

Share this post


Link to post
Share on other sites
quote:
Original post by Orb
I researched the 3ds file format, and came up with a basic loader for it. It works good and renders well, so is there any reason not to stick with it now? I understand it really well, and can work with it, but now I don''t see a reason not to stick with it.



If you need normals for lighting, you must calculate them yourself.

Share this post


Link to post
Share on other sites
I found it incredibly simple to parse an .ASE file for models. They''ll actually hold animation and stuff too, but I never bothered with that. If you just want the model, you can start from there and design your own format.

ASE looks something like this...

*MODEL {
*VERTEX_COUNT 200
*FACE_COUNT 225
*MATERIAL_COUNT 3
ETC...
}
*VERTICES {
1: X: 3.22 Y: 4.33 Z: 1.11
2: X: 1.44 Y: 3.22 Z: 1.11
... ETC.
}
*FACES {
1: A: 1 B: 2 C: 3 MATERIAL: 1
2: A: 2 B: 3 C: 4 MATERIAL: 1
ETC....
}

Of course, I just made it all up, but my point is that it is very readable... you have vertices you can read in, and you have faces defined by vertex indices, etc.


Share this post


Link to post
Share on other sites
If I were you guys Id use the MilkShape 3D format. Its simple to break appart and easy to understand (plus the programs cheap but its developing into an amazing modeling program fast!). Im currently using it with a nice simple game and it seems to hold its own fairly well.

Share this post


Link to post
Share on other sites

  • Advertisement