3d Model Formats

Started by
1 comment, last by fire332211 14 years, 2 months ago
Hi, I am interested in loading quake .bsp files, but first I need understand how the 3d geometry is stored when saving a 3d model to any format in general. I understand that when a model is rendered, it is made up of triangles, but could you please explain how exactly the data is stored in a file? Thanks
Advertisement
Quote:I need understand how the 3d geometry is stored when saving a 3d model to any format in general

That's a very general question, and the best I can do is give you a very general answer as there are many file formats for geometry of various sorts.

Data generally appears as one or more of the following groups:

Vertex data (usually in a set of 3 coordinates X, Y, Z)
Normal data (usually in a set of 3 values nx, ny, nz)
Face indices ( a set of 3 vertex indices which form a triangle )
Texture coordinates ( a set of 2 values tu, tv )
Materials ( a set of values perhaps containing color, a texture name, etc. )

Each of those data sets is usually preceded by some sort of indication of what group follows. E.g., for vertex data-
// a DirectX meshMesh {  234; // number of vertices in mesh  0.715, 0.5, 1.0;,  0.715, 0.3, 1.0;,  ...}// an OBJ filev 0.715 0.5 1.0 // each set of vertex data preceded by 'v'v 0.715 0.3 1.0...

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Quote:Original post by Buckeye
Quote:I need understand how the 3d geometry is stored when saving a 3d model to any format in general

That's a very general question, and the best I can do is give you a very general answer as there are many file formats for geometry of various sorts.

Data generally appears as one or more of the following groups:

Vertex data (usually in a set of 3 coordinates X, Y, Z)
Normal data (usually in a set of 3 values nx, ny, nz)
Face indices ( a set of 3 vertex indices which form a triangle )
Texture coordinates ( a set of 2 values tu, tv )
Materials ( a set of values perhaps containing color, a texture name, etc. )

Each of those data sets is usually preceded by some sort of indication of what group follows. E.g., for vertex data-
// a DirectX meshMesh {  234; // number of vertices in mesh  0.715, 0.5, 1.0;,  0.715, 0.3, 1.0;,  ...}// an OBJ filev 0.715 0.5 1.0 // each set of vertex data preceded by 'v'v 0.715 0.3 1.0...


Thanks a lot, that's just what I needed

This topic is closed to new replies.

Advertisement