You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this issue when building this example: https://kion-dgl.github.io/three-cbor-loader/ because the model wasn't loading for the CBOR model, but it worked when emulated loading the CBOR model by loading the JSON and putting in ArrayBuffer where they were expected.
The problem is that I wanted to work with an ArrayBuffer, not a Uint8Array. So I used cbor.myData.buffer and got the entire CBOR ArrayBuffer back and not the section sliced out that I wanted.
I recommend using ArrayBuffer.slice to only return the section of the CBOR data that corresponds to what the programmer is expecting for that attribute.
I ran into this issue when building this example: https://kion-dgl.github.io/three-cbor-loader/ because the model wasn't loading for the CBOR model, but it worked when emulated loading the CBOR model by loading the JSON and putting in ArrayBuffer where they were expected.
The issue turned out to be here: https://github.com/paroga/cbor-js/blob/master/cbor.js#L199
The problem is that I wanted to work with an ArrayBuffer, not a Uint8Array. So I used
cbor.myData.buffer
and got the entire CBOR ArrayBuffer back and not the section sliced out that I wanted.I recommend using ArrayBuffer.slice to only return the section of the CBOR data that corresponds to what the programmer is expecting for that attribute.
The text was updated successfully, but these errors were encountered: