goat3d

view doc/goatfmt @ 88:7941e89798e5

selections
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 15 May 2014 06:52:01 +0300
parents f1b4c27382ce
children
line source
1 Goat3D scene file format
2 ------------------------
4 Chunk structure
5 ---------------
7 Leaf nodes which carry actual data are marked with <SINGLE_CHILD>, or
8 [MULTIPLE_CHILDREN]. Where choice is involved, options are seperated with the |
9 symbol.
11 SCENE
12 +--ENV
13 | +--AMBIENT
14 | | +--<FLOAT3>
15 | +--FOG
16 | +--FOG_COLOR
17 | | +--<FLOAT3>
18 | +--FOG_EXP
19 | +--<FLOAT>
20 +--MTL
21 | +--MTL_NAME
22 | | +--<STRING>
23 | +--MTL_ATTR
24 | +--MTL_ATTR_NAME
25 | | +--<STRING>
26 | +--MTL_ATTR_VAL
27 | | +--<FLOAT|FLOAT3|FLOAT4>
28 | +--MTL_ATTR_MAP
29 | +--<STRING> (filename)
30 +--MESH
31 | +--MESH_NAME
32 | | +--<STRING>
33 | +--MESH_MATERIAL
34 | | +--<STRING|INT> (material name or index)
35 | +--MESH_VERTEX_LIST
36 | | +--[FLOAT3]
37 | +--MESH_NORMAL_LIST
38 | | +--[FLOAT3]
39 | +--MESH_TANGENT_LIST
40 | | +--[FLOAT3]
41 | +--MESH_TEXCOORD_LIST
42 | | +--[FLOAT3]
43 | +--MESH_SKINWEIGHT_LIST
44 | | +--[FLOAT4] (vector elements are the 4 skin weights/vertex)
45 | +--MESH_SKINMATRIX_LIST
46 | | +--[INT4] (vector elements are the 4 matrix indices/vertex)
47 | +--MESH_COLOR_LIST
48 | | +--[FLOAT4]
49 | +--MESH_BONES_LIST
50 | | +--[INT|STRING] (list of bone nodes by name or index)
51 | +--MESH_FACE_LIST
52 | | +--MESH_FACE
53 | | +--[INT] (three INT chunks for the vertex indices)
54 | +--MESH_FILE
55 | +--<STRING> (filename of mesh file to get all the data from)
56 +--LIGHT
57 | +--LIGHT_NAME
58 | | +--<STRING>
59 | +--LIGHT_POS
60 | | +--<FLOAT3>
61 | +--LIGHT_COLOR
62 | | +--<FLOAT3>
63 | +--LIGHT_ATTEN
64 | | +--<FLOAT3> (constant, linear, and quadratic attenuation)
65 | +--LIGHT_DISTANCE
66 | | +--<FLOAT>
67 | +--LIGHT_DIR
68 | | +--<FLOAT3>
69 | +--LIGHT_CONE_INNER
70 | | +--<FLOAT>
71 | +--LIGHT_CONE_OUTER
72 | +--<FLOAT>
73 +--CAMERA
74 | +--CAMERA_NAME
75 | | +--<STRING>
76 | +--CAMERA_POS
77 | | +--<FLOAT3>
78 | +--CAMERA_TARGET
79 | | +--<FLOAT3>
80 | +--CAMERA_FOV
81 | | +--<FLOAT>
82 | +--CAMERA_NEARCLIP
83 | | +--<FLOAT>
84 | +--CAMERA_FARCLIP
85 | +--<FLOAT>
86 +--NODE
87 +--NODE_NAME
88 | +--<STRING>
89 +--NODE_PARENT
90 | +--<INT|STRING>
91 +--NODE_MESH|NODE_LIGHT|NODE_CAMERA
92 | +--<INT|STRING>
93 +--NODE_POS
94 | +--<FLOAT3>
95 +--NODE_ROT
96 | +--<FLOAT4> ([x, y, z], w <- real part)
97 +--NODE_SCALE
98 | +--<FLOAT3>
99 +--NODE_PIVOT
100 | +--<FLOAT3>
101 +--NODE_MATRIX0
102 | +--<FLOAT4> (first row)
103 +--NODE_MATRIX1
104 | +--<FLOAT4> (second row)
105 +--NODE_MATRIX2
106 +--<FLOAT4> (third row)
108 NOTES:
109 * Name chunks are mandatory. If something doesn't have a name, one must be made
110 up, even if it's just "object%d".
111 * In node chunks, both POS/ROT/SCALE, and MATRIX0/MATRIX1/MATRIX2 are mandatory
112 and they must agree. Makes it easy for the reader to pick the transformation
113 data in whichever way is more convenient.