patterns: Added a few voxel model patterns (#74)

* patterns: added a few voxel model patterns

* patterns: updated qbcl

according to https://gist.github.com/tostc/7f049207a2e5a7ccb714499702b5e2fd

* readme: added new voxel format petterns to the readme

* tests: added vxl test file

* ccvxl: updated two fields
This commit is contained in:
Martin Gerhardy
2023-01-13 20:19:06 +01:00
committed by GitHub
parent 5ea7141cb7
commit 8ab2ff4ab1
6 changed files with 196 additions and 0 deletions

80
patterns/qbcl.hexpat Normal file
View File

@@ -0,0 +1,80 @@
// Qubicle QBCL format
struct String {
u32 len;
char string[len];
};
struct Matrix {
u32 sizex;
u32 sizey;
u32 sizez;
s32 tx;
s32 ty;
s32 tz;
float pivotx;
float pivoty;
float pivotz;
u32 compressedDataSize;
u8 zip[compressedDataSize];
};
// Rotation matrix according to wikipedia
// https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations
struct Matrices {
float row1[3];
float row2[3];
float row3[3];
};
using Node;
struct Model {
Matrices rotation;
u32 childCount;
Node nodes[childCount];
};
struct Compound {
Matrix matrix;
u32 childCount;
Node nodes[childCount];
};
struct Node {
u32 type;
u32 unknown;
String name;
u8 visible;
u8 unknown2;
u8 locked;
if (type == 0) {
Matrix matrix;
} else if (type == 1) {
Model model;
} else if (type == 2) {
Compound compound;
}
};
struct Header {
u32 magic;
u32 version;
u32 fileversion;
u32 thumbwidth;
u32 thumbheight;
char bgra[thumbwidth * thumbheight * 4];
String title;
String desc;
String metadata;
String author;
String company;
String website;
String copyright;
// Maybe change and creation time?
double time1;
double time2;
Node node;
};
Header hdr @0x00;