二進制的GLTF
前面有20個字節的數據說明
代碼實現:(data是gltf二進制存儲的數據字符串,bindata二進制模型數據)
byte[] head_gltf1 = System.Text.Encoding.UTF8.GetBytes("glTF");
byte[] head_gltf2 = new byte[] { 1, 0, 0, 0 };
byte[] head_gltf3 = BitConverter.GetBytes(20 + data.Length + bindata.Length);
byte[] head_gltf4 = BitConverter.GetBytes(data.Length);
byte[] head_gltf5 = new byte[] { 0, 0, 0, 0 };
內容解釋:

B3DM
代碼實現
byte[] head_b3dm1 = System.Text.Encoding.UTF8.GetBytes("b3dm");
byte[] head_b3dm2 = new byte[] { 1, 0, 0, 0 };
byte[] head_b3dm3 = BitConverter.GetBytes(24 + 20 + data.Length + bindata.Length);
byte[] head_b3dm4 = new byte[] { 0, 0, 0, 0 };
byte[] head_b3dm5 = new byte[] { 0, 0, 0, 0 };
byte[] head_b3dm6 = new byte[] { 0, 0, 0, 0 };

| 字段名稱 | 數據類型 | 描述 |
|---|---|---|
magic |
4字節ANSI字符串 | "b3dm"。標識數據類型。 |
version |
uint32 |
b3dm模型格式的版本。目前是1。 |
byteLength |
uint32 |
整個瓦片的長度,包括標題,以字節為單位。 |
featureTableJSONByteLength |
uint32 |
特征表JSON部分的長度(以字節為單位)。零表示沒有功能表。 |
featureTableBinaryByteLength |
uint32 |
特征表二進制部分的長度(以字節為單位)。如果featureTableJSONByteLength為零,這也將為零。 |
batchTableJSONByteLength |
uint32 |
批處理表JSON部分的長度(以字節為單位)。零表示沒有批處理表。 |
batchTableBinaryByteLength |
uint32 |
批處理表二進制部分的長度(以字節為單位)。如果batchTableJSONByteLength為零,這也將為零。 |
