Professional Documents
Culture Documents
MagicaVoxel File Format Vox Extension
MagicaVoxel File Format Vox Extension
MagicaVoxel File Format Vox Extension
=================================
(a) STRING type
=================================
(b) DICT type
=================================
(c) ROTATION type
for example :
R =
0 1 0
0 0 -1
-1 0 0
==>
unsigned char _r = (1 << 0) | (2 << 2) | (0 << 4) | (1 << 5) | (1 << 6)
bit | value
0-1 : 1 : index of the non-zero entry in the first row
2-3 : 2 : index of the non-zero entry in the second row
4 : 0 : the sign in the first row (0 : positive; 1 : negative)
5 : 1 : the sign in the second row (0 : positive; 1 : negative)
6 : 1 : the sign in the third row (0 : positive; 1 : negative)
=================================
(d) Scene Graph
T : Transform Node
G : Group Node
S : Shape Node
T
|
G
/ \
T T
| |
G S
/ \
T T
| |
S S
=================================
(1) Transform Node Chunk : "nTRN"
int32 : node id
DICT : node attributes
(_name : string)
(_hidden : 0/1)
int32 : child node id
int32 : reserved id (must be -1)
int32 : layer id
int32 : num of frames (must be 1)
=================================
(2) Group Node Chunk : "nGRP"
int32 : node id
DICT : node attributes
int32 : num of children nodes
=================================
(3) Shape Node Chunk : "nSHP"
int32 : node id
DICT : node attributes
int32 : num of models (must be 1)
=================================
(4) Material Chunk : "MATL"
int32 : material id
DICT : material properties
(_type : str) _diffuse, _metal, _glass, _emit
(_weight : float) range 0 ~ 1
(_rough : float)
(_spec : float)
(_ior : float)
(_att : float)
(_flux : float)
(_plastic)
=================================
(5) Layer Chunk : "LAYR"
int32 : layer id
DICT : layer atrribute
(_name : string)
(_hidden : 0/1)
int32 : reserved id, must be -1