Open monoto opened 2 years ago
@monoto it doesn't seem like the part of your code setting the vertex attribute is included in the snippet above (around the comment // handle geometry
), so I can't quite tell what's going wrong. It's also possible that the API of the Draco library has changed a bit, which would be outside the scope of the glTF specification and perhaps better addressed with an issue on the Draco library's repository.
In case it's helpful, here's some of my own code implementing Draco decoding in gltf-transform:
I am having trouble with this exported GLFT model with Draco Compression and your document is not helping. The UV coordinate came out all wrong. There are 3 primitives each pointing to a different BufferView.
My code to iterate over primitives to extract geometry:
Without Draco, the model looks like: With Draco:
Looking into BufferGeometry that decodeDracoFile spit out, it contains correct number of float32s and each between [0, 1].
Not sure what the problem is.
Do I still need to get the UV from attributes and ignore what comes out of the BufferView?
Since the indices and positions seem to be correctly extracted from bufferView. why are uvs the exception?