提交 14d8682b 编写于 作者: A AR-DESKTOP\angel

according to gltf 2.0 spec, byteStride is a property of bufferView

上级 acdac7de
......@@ -1781,17 +1781,17 @@ THREE.GLTF2Loader = ( function () {
// For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.
var elementBytes = TypedArray.BYTES_PER_ELEMENT;
var itemBytes = elementBytes * itemSize;
var byteStride = json.bufferViews[accessor.bufferView].byteStride;
var array;
// The buffer is not interleaved if the stride is the item size in bytes.
if ( accessor.byteStride && accessor.byteStride !== itemBytes ) {
if ( byteStride && byteStride !== itemBytes ) {
// Use the full buffer if it's interleaved.
array = new TypedArray( arraybuffer );
// Integer parameters to IB/IBA are in array elements, not bytes.
var ib = new THREE.InterleavedBuffer( array, accessor.byteStride / elementBytes );
var ib = new THREE.InterleavedBuffer( array, byteStride / elementBytes );
return new THREE.InterleavedBufferAttribute( ib, itemSize, accessor.byteOffset / elementBytes );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册