Closed StarArawn closed 3 years ago
I'm pulling positions out of a gltf using:
let reader = primitive.reader(|buffer| Some(&buffer_data[buffer.index()])); if let Some(positions) = reader .read_positions() { ... }
This works fine for most of my meshes however one mesh fails when reading the positions with the following error:
accessor.index() = 0 accessor.dimensions().multiplicity() = 3 accessor.data_type().size() = 2 accessor.data_type() = U16 thread 'main' panicked at 'assertion failed: `(left == right)` left: `12`, right: `6`', \github.com-1ecc6299db9ec823\gltf-0.16.0\src\accessor\util.rs:338:13
This mesh works in common C++/javascript gltf viewers.
I'm 100% sure that the data_type should not be U16 for the positions. In fact looking at the gltf data I see that accessor index 0 is:
accessor index 0
{ "bufferView": 0, "componentType": 5126, "count": 10, "max": [ 6.312699794769287, 0.0348999984562397, -0.2665998637676239 ], "min": [ -6.312699794769287, 0.0348999984562397, -4.096299171447754 ], "type": "VEC3" },
Nevermind, the issue was on my side.
I'm pulling positions out of a gltf using:
This works fine for most of my meshes however one mesh fails when reading the positions with the following error:
This mesh works in common C++/javascript gltf viewers.
I'm 100% sure that the data_type should not be U16 for the positions. In fact looking at the gltf data I see that
accessor index 0
is: