Jump to content
  • Advertisement
Sign in to follow this  
fire332211

3d Model Formats

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

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

Share this post


Link to post
Share on other sites
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 mesh
Mesh {
234; // number of vertices in mesh
0.715, 0.5, 1.0;,
0.715, 0.3, 1.0;,
...
}
// an OBJ file
v 0.715 0.5 1.0 // each set of vertex data preceded by 'v'
v 0.715 0.3 1.0
...

Share this post


Link to post
Share on other sites
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 mesh
Mesh {
234; // number of vertices in mesh
0.715, 0.5, 1.0;,
0.715, 0.3, 1.0;,
...
}
// an OBJ file
v 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

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!