What's the default object file format

Started by
11 comments, last by jerry2 22 years, 8 months ago
As we all know,direct3d uses the *.x as the default object calling format.But what''s the default object calling format for OpenGl? And what graphical format is better for 3d programming? tga,bmp,jpg or ? jerry2
jerry2The God creates the world, the world creates the nature,the nature creates human. Human create...Everything.
Advertisement
A/ there is none. also u will actually find most commerical games in d3d dont use the x format.
B/ ultimatly it makes no difference opengl will see them all the same anyways.
so choice is based on loading times + other factors

im talking about standard formats here
bmp - bad ( no alpha or compression ) good ( simple format )
tga - bad ( no compression ) good ( simple + does alpha )
jpg - bad ( no alpha ) good ( compression though loosy + quite hard to load unless u use a library )
png - bad ( ) good ( loseless compression but difficult to read unless u use a library )
For 3D formats, I know:

QuakeII (*.md2): simple, fast loading, fast drawing, simple animation, but not hierarchy, no material, single texture

QuakeIII (*.md3): a bit more complex but with hierarchy and multiple textures -> simply the best

3DS: very hard to use, but include everything you want

X: simple with directX, but very complex with OpenGL, nice but slower drawing and loading than md3
TGA files can be compressed, it is part of the Targa format spec''s. IIRC it uses a RLE (Run Length Encoding) compression for the images, it''s not as good as PNG for compression, but the format is easier to understand than PNG and it''s easier to read!


When I find my code in tons of trouble,
Friends and colleages come to me,
Speaking words of wisdom:
"Write in C."
When I find my code in tons of trouble,Friends and colleages come to me,Speaking words of wisdom:"Write in C."My Web Site
quote:
QuakeIII (*.md3): a bit more complex but with hierarchy and multiple textures -> simply the best


I really don''t know why certain people always fly on this Q3 format, simply because it''s Q3 and from Carmack doesn''t mean it''s good.
MD3 is a format that has been developed for the Q3 engine, and it''s surely good for it. But it might be total crap for your engine, if your basic design is different. It is definitely NOT a multipurpose format. There is no such multipurpose format in the 3D world anyways, except *.3DS perhaps, but it has some severe limitations (max. 65535 faces per object, buggy hierarchies...)

There are only two possibilities:
1) if you are just playing around with OpenGL, no real 3D engine design yet, then use an ASCII format, such as OBJ or ASE. It''s slow to parse but simple and you can even edit it by hand.
2) If you have a real engine: use your own format, optimized for your engine structure. This is the only way to go, you will have every data you need, it can be expanded as your engine grows and it''ll be ways faster to load.

- JL
John Carmak is not my gourou, but *.md3 is just good for me.

My first 3D app was a *.md2 viewer, so I think it is not very complex compared to ASCII format parsing.
Well, it''s OK if md3 suits your needs. But it shouldn''t be used as a multiple purpose format, because it is none. It''s not about simplicity either, it''s just as simple to write an md3 loader as an ase loader.

But: ASE and especially OBJ are accepted standards, they are directly supported by all major 3D modelling packages, and they contain a lot more information than md3 files.

If a beginner starts with an md3 type fileformat, then he might miss very interesting information other, really multiple purpose, standards would give him. Eg. a lot of people (even advanced) still don''t know what the W-coordinate (not the homogeneous, the texture mapping one: UVW) is, and how it is used. Game 3d formats don''t contain such data, because the game doesn''t need it, but this does not mean, that it doesn''t exist.

Another very important point to start with an ASCII format: you can look at it and modify it with a simple editor. This is extremly usefull, eg. "hmm, there''s a bug in my normal transformation code, what would happen, if I just modified this single normal value to (1,0,0)... ?" That''s a lot harder with binary formats.


Ok anonymous master, you''re right, excuse me for giving my opinion!

PS: I''ve see that opengl can handle 4 textures coordinates, can you explain what is the goal of the two last?
i know people always make a module to read several 3d file format,commonly don''t use the X files.
and now i know the 3ds and tga format r the suitable ones to use for 3d programming,is that true?

jerry2
jerry2The God creates the world, the world creates the nature,the nature creates human. Human create...Everything.
bobatefrei:

> Ok anonymous master, you''re right, excuse me for giving my opinion!

hmmm... I just pointed out the advantages of an ASCII format for a beginner, where is your problem ? If you want to use md3, it''s fine for you !

> PS: I''ve see that opengl can handle 4 textures coordinates, can you explain what is the goal of the two last?

OpenGL texcoords are s,t,r and q. s and t are the normal u and v type mapping coordinates you use every day. r is simply used for 3d volume textures, not interesting for now, but will be in the future, when hardware gets more powerful.
The q coordinate is very interesting, it''s the homogeneous coordinate of a texture ''vector'', what the w coordinate is for normal homogeneous vectors. You can use it (by means of the OpenGL texture matrix) for special projections of texture coordinates, such as multiple perspective projections, used for projective textures, light effects and other cool effects.

This topic is closed to new replies.

Advertisement