Jump to content

  • Log In with Google      Sign In   
  • Create Account

What's the default object file format


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
12 replies to this topic

#1 jerry2   Members   -  Reputation: 122

Like
Likes
Like

Posted 31 July 2001 - 01:44 PM

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

Sponsor:

#2 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 31 July 2001 - 05:25 PM

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 )

#3 bobatefrei   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 August 2001 - 12:14 AM

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

#4 Steven   Members   -  Reputation: 136

Like
Likes
Like

Posted 01 August 2001 - 01:49 AM

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

#5 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 01 August 2001 - 02:12 AM

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


#6 bobatefrei   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 August 2001 - 05:34 AM

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.

#7 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 01 August 2001 - 08:55 AM

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.




#8 bobatefrei   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 August 2001 - 09:55 AM

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?

#9 jerry2   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 August 2001 - 02:30 PM

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

#10 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 01 August 2001 - 04:07 PM

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.


#11 Marvin   Members   -  Reputation: 127

Like
Likes
Like

Posted 01 August 2001 - 10:00 PM

Im a beginner :o)

i created my own simple ASCII format that I can understand, just contains a few simple command that i can parse into a compiled display list, does the job nicely and i can add features to this format as needed.

One thing you guys might be able to help with is howto protect a file format from user modification. I was thinking about using some kind of "broken" compression?

#12 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 02 August 2001 - 03:50 AM

quote:

One thing you guys might be able to help with is howto protect a file format from user modification. I was thinking about using some kind of "broken" compression?



Just use a crc algorithm, that computes a checksum of your file. You can use compression or even encryption prior to the CRC check, so that it gets even more difficult to alter the file. With the nice side effect of a reduced filesize. Esp. ASCII formats compress very well.


#13 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 02 August 2001 - 10:32 AM

for all fileformats except images + sound ild go with an ascii (readable version) i wish i originally had done so it would of cut weeks (no exageration) off my development time. its an very easy task to convert them to some binary format just before release




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS