Brakebein/node-three-gltf

Buffer.buffer contains incorrect data

misty000 opened this issue · 2 comments

I found geometry.attributes data is wrong.
The reason is Buffer.buffer 's data is ArrayBuffer(8192).

f1fdab6ae68dd35f24cc4f5c67f79e5

node version: 16
"dependencies": {
"base64-js": "1.5.1",
"node-three-gltf": "1.3.0",
"three": "0.147.0"
}

no matter what the base64 string is, Buffer.buffer is always the same

First, I wasn't sure about what the issue is, since Buffer.buffer is of course an instance of ArrayBuffer. But I actually have one test file which failed to load and I couldn't find the reason why, even though other files from the same converter output didn't cause any issues. So, node.js Buffer.from(string[, encoding]) obviously has some problems with binary data. The base64-js package did the trick and my problematic gltf file finally loaded. So, thanks for pointing out.