Custom 3D Model Format

Hey guys…

So I’ve been experimenting with designing my own file format for holding 3D data. I call it SDS.

Here is an example of a cube:

// SDS format by Jake Haas
// Exported with Unity 2.6.1f3

StartObject [Cube] {

Translation [2.070201,-47.29834,73.69731]
Rotation [0,0,0]
Scale [1,1,1]

numVertices [24]
numTriangles [12]
numNormals [24]
numUVs [24]

Vertices {
0 [0.5,-0.5,0.5]
1 [-0.5,-0.5,0.5]
2 [0.5,0.5,0.5]
3 [-0.5,0.5,0.5]
4 [0.5,0.5,-0.5]
5 [-0.5,0.5,-0.5]
6 [0.5,-0.5,-0.5]
7 [-0.5,-0.5,-0.5]
8 [0.5,0.5,0.5]
9 [-0.5,0.5,0.5]
10 [0.5,0.5,-0.5]
11 [-0.5,0.5,-0.5]
12 [0.5,-0.5,-0.5]
13 [-0.5,-0.5,0.5]
14 [-0.5,-0.5,-0.5]
15 [0.5,-0.5,0.5]
16 [-0.5,-0.5,0.5]
17 [-0.5,0.5,-0.5]
18 [-0.5,-0.5,-0.5]
19 [-0.5,0.5,0.5]
20 [0.5,-0.5,-0.5]
21 [0.5,0.5,0.5]
22 [0.5,-0.5,0.5]
23 [0.5,0.5,-0.5]
}

Triangles {
0 [1,0,3]
1 [3,0,2]
2 [9,8,5]
3 [5,8,4]
4 [11,10,7]
5 [7,10,6]
6 [14,12,13]
7 [13,12,15]
8 [18,16,17]
9 [17,16,19]
10 [22,20,21]
11 [21,20,23]
}

Normals {
0 [0,0,1]
1 [0,0,1]
2 [0,0,1]
3 [0,0,1]
4 [0,1,0]
5 [0,1,0]
6 [0,0,-1]
7 [0,0,-1]
8 [0,1,0]
9 [0,1,0]
10 [0,0,-1]
11 [0,0,-1]
12 [0,-1,0]
13 [0,-1,0]
14 [0,-1,0]
15 [0,-1,0]
16 [-1,0,0]
17 [-1,0,0]
18 [-1,0,0]
19 [-1,0,0]
20 [1,0,0]
21 [1,0,0]
22 [1,0,0]
23 [1,0,0]
}

UVs {
0 [0,0]
1 [1,0]
2 [0,1]
3 [1,1]
4 [0,1]
5 [1,1]
6 [0,1]
7 [1,1]
8 [0,0]
9 [1,0]
10 [0,0]
11 [1,0]
12 [0,0]
13 [1,1]
14 [1,0]
15 [0,1]
16 [0,0]
17 [1,1]
18 [1,0]
19 [0,1]
20 [0,0]
21 [1,1]
22 [1,0]
23 [0,1]
}

} [EndObject]

So far I have an importer and exporter working for both Maya and Unity. They support Verts, UVs, Tris, Normals and scale, translation etc.

If anyone has any hints for for storing bones and animation info, please chime in.

-Jake

  1. for what? :slight_smile:
  2. did you look at .smd or .md5 formats? they can help you with bones and can give you basic ideas of animation :slight_smile:

Well, It started as a way to store mesh data that would be manipulated in game, but I never ended up using it, so I am just continuing as a learning experience.

I’ll take a look. Thanks :smile: