aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: aea419d3377b3c3f3b456e124ea459753da8a0d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
This is a program that uses assimp to convert different 3d model formats to file format that amalgine can read (.a3d).
To see a list of supported file formats, see https://github.com/assimp/assimp#supported-file-formats (this is for the latest version of assimp).

# Amalgine 3D model file format (.a3d)
.a3d is a binary file format. All types are stored in little endian format. Any type with a * is optional.

|Type   |Description                                                                          |
|-------|-------------------------------------------------------------------------------------|
|u32    |The magic number, the value will always be 0x036144AF.                               |
|u32    |Version of the file format. This is backwards compatible but not forwards compatible.|
|mesh[] |The mesh data.                                                                       |

mesh:

|Type       |Description                                                                                     |
|-----------|------------------------------------------------------------------------------------------------|
|u32        |The number of vertices, normals and optionally texture coordinates.                             |
|vec3f[]    |A list of vertices.                                                                             |
|vec3f[]    |A list of normals.                                                                              |
|u32        |1 if the model has texture coordinates, otherwise 0.                                            |
|vec2f[]*   |A list of texture coordinates. The number of texture coordinates matches the number of vertices.|
|u32        |The number of faces.                                                                            |
|face[]     |The face indices.                                                                               |
|u32        |1 if the model has materials, otherwise 0.                                                      |
|material[3]|The material data. This is a list of [diffuse, specular, ambient] materials.                    |

vec2f:

|Type |Description     |
|-----|----------------|
|float|The x coordiate.|
|float|The y coordiate.|

vec3f:

|Type |Description     |
|-----|----------------|
|float|The x coordiate.|
|float|The y coordiate.|
|float|The z coordiate.|

face:

|Type|Description      |
|----|-----------------|
|u32 |The first index. |
|u32 |The second index.|
|u32 |The third index. |

material:

|Type  |Description                                                                |
|------|---------------------------------------------------------------------------|
|u32   |The number of textures.                                                    |
|char[]|The filepaths to the textures (relative). This is a null-terminated string.|

## TODO
Handle big endian