goat3d

diff doc/goatfmt @ 14:188c697b3b49

- added a document describing the goat3d file format chunk hierarchy - started an alternative XML-based file format - added the openctm library
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 26 Sep 2013 04:47:05 +0300
parents
children f1b4c27382ce
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc/goatfmt	Thu Sep 26 04:47:05 2013 +0300
     1.3 @@ -0,0 +1,110 @@
     1.4 +Chunk structure
     1.5 +---------------
     1.6 +
     1.7 +Leaf nodes which carry actual data are marked with <SINGLE_CHILD>, or
     1.8 +[MULTIPLE_CHILDREN]. Where choice is involved, options are seperated with the |
     1.9 +symbol.
    1.10 +
    1.11 +SCENE
    1.12 + +--ENV
    1.13 + |   +--AMBIENT
    1.14 + |   |   +--<FLOAT3>
    1.15 + |   +--FOG
    1.16 + |       +--FOG_COLOR
    1.17 + |       |   +--<FLOAT3>
    1.18 + |       +--FOG_EXP
    1.19 + |           +--<FLOAT>
    1.20 + +--MTL
    1.21 + |   +--MTL_NAME
    1.22 + |   |   +--<STRING>
    1.23 + |   +--MTL_ATTR
    1.24 + |       +--MTL_ATTR_NAME
    1.25 + |       |   +--<STRING>
    1.26 + |       +--MTL_ATTR_VAL
    1.27 + |       |   +--<FLOAT|FLOAT3|FLOAT4>
    1.28 + |       +--MTL_ATTR_MAP
    1.29 + |           +--<STRING>      (filename)
    1.30 + +--MESH
    1.31 + |   +--MESH_NAME
    1.32 + |   |   +--<STRING>
    1.33 + |   +--MESH_MATERIAL
    1.34 + |   |   +--<STRING>          (material name)
    1.35 + |   +--MESH_VERTEX_LIST
    1.36 + |   |   +--[FLOAT3]
    1.37 + |   +--MESH_NORMAL_LIST
    1.38 + |   |   +--[FLOAT3]
    1.39 + |   +--MESH_TANGENT_LIST
    1.40 + |   |   +--[FLOAT3]
    1.41 + |   +--MESH_TEXCOORD_LIST
    1.42 + |   |   +--[FLOAT3]
    1.43 + |   +--MESH_SKINWEIGHT_LIST
    1.44 + |   |   +--[FLOAT4]          (vector elements are the 4 skin weights/vertex)
    1.45 + |   +--MESH_SKINMATRIX_LIST
    1.46 + |   |   +--[INT4]            (vector elements are the 4 matrix indices/vertex)
    1.47 + |   +--MESH_COLOR_LIST
    1.48 + |   |   +--[FLOAT4]
    1.49 + |   +--MESH_BONES_LIST
    1.50 + |   |   +--[INT|STRING]      (list of bone nodes by name or index)
    1.51 + |   +--MESH_FACE_LIST
    1.52 + |   |   +--MESH_FACE
    1.53 + |   |       +--[INT]         (three INT chunks for the vertex indices)
    1.54 + |   +--MESH_FILE
    1.55 + |       +--<STRING>          (filename of mesh file to get all the data from)
    1.56 + +--LIGHT
    1.57 + |   +--LIGHT_NAME
    1.58 + |   |   +--<STRING>
    1.59 + |   +--LIGHT_POS
    1.60 + |   |   +--<FLOAT3>
    1.61 + |   +--LIGHT_COLOR
    1.62 + |   |   +--<FLOAT3>
    1.63 + |   +--LIGHT_ATTEN
    1.64 + |   |   +--<FLOAT3>           (constant, linear, and quadratic attenuation)
    1.65 + |   +--LIGHT_DISTANCE
    1.66 + |   |   +--<FLOAT>
    1.67 + |   +--LIGHT_DIR
    1.68 + |   |   +--<FLOAT3>
    1.69 + |   +--LIGHT_CONE_INNER
    1.70 + |   |   +--<FLOAT>
    1.71 + |   +--LIGHT_CONE_OUTER
    1.72 + |       +--<FLOAT>
    1.73 + +--CAMERA
    1.74 + |   +--CAMERA_NAME
    1.75 + |   |   +--<STRING>
    1.76 + |   +--CAMERA_POS
    1.77 + |   |   +--<FLOAT3>
    1.78 + |   +--CAMERA_TARGET
    1.79 + |   |   +--<FLOAT3>
    1.80 + |   +--CAMERA_FOV
    1.81 + |   |   +--<FLOAT>
    1.82 + |   +--CAMERA_NEARCLIP
    1.83 + |   |   +--<FLOAT>
    1.84 + |   +--CAMERA_FARCLIP
    1.85 + |       +--<FLOAT>
    1.86 + +--NODE
    1.87 +     +--NODE_NAME
    1.88 +     |   +--<STRING>
    1.89 +     +--NODE_PARENT
    1.90 +     |   +--<INT|STRING>
    1.91 +     +--NODE_MESH|NODE_LIGHT|NODE_CAMERA
    1.92 +     |   +--<INT|STRING>
    1.93 +     +--NODE_POS
    1.94 +     |   +--<FLOAT3>
    1.95 +     +--NODE_ROT
    1.96 +     |   +--<FLOAT4>           ([x, y, z], w <- real part)
    1.97 +     +--NODE_SCALE
    1.98 +     |   +--<FLOAT3>
    1.99 +     +--NODE_PIVOT
   1.100 +     |   +--<FLOAT3>
   1.101 +     +--NODE_MATRIX0
   1.102 +     |   +--<FLOAT4>           (first row)
   1.103 +     +--NODE_MATRIX1
   1.104 +     |   +--<FLOAT4>           (second row)
   1.105 +     +--NODE_MATRIX2
   1.106 +         +--<FLOAT4>           (third row)
   1.107 +
   1.108 +NOTES:
   1.109 + * Name chunks are mandatory. If something doesn't have a name, one must be made
   1.110 +   up, even if it's just "object%d".
   1.111 + * In node chunks, both POS/ROT/SCALE, and MATRIX0/MATRIX1/MATRIX2 are mandatory
   1.112 +   and they must agree. Makes it easy for the reader to pick the transformation
   1.113 +   data in whichever way is more convenient.