# 3d Model Formats

## 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

##### Share on other sites
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...

#### Share this 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 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

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account

## Sign in

Already have an account? Sign in here.

Sign In Now

• ### Forum Statistics

• Total Topics
628356
• Total Posts
2982253

• 10
• 9
• 13
• 24
• 11