二进制的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 为零,这也将为零。 |