浏览代码

Further testing showed that in case of header being UInt32 VTK sets only the header to 4 bytes per value, while the data remains 8 bytes

Andrii Iudin 8 年之前
父节点
当前提交
19101032d1
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      examples/js/loaders/VTKLoader.js

+ 2 - 1
examples/js/loaders/VTKLoader.js

@@ -743,7 +743,8 @@ Object.assign( THREE.VTKLoader.prototype, THREE.EventDispatcher.prototype, {
 						for ( var i = 0; i<blocks; i++ ) {
 						for ( var i = 0; i<blocks; i++ ) {
 							var currentBlockSize = byteData[i*numBytes + cSizeStart];
 							var currentBlockSize = byteData[i*numBytes + cSizeStart];
 							for ( var j = 1; j<numBytes-1; j++ ) {
 							for ( var j = 1; j<numBytes-1; j++ ) {
-								currentBlockSize = currentBlockSize | ( byteData[i*numBytes + cSizeStart + j] << (j*numBytes) );
+								// Each data point consists of 8 bytes regardless of the header type
+								currentBlockSize = currentBlockSize | ( byteData[i*numBytes + cSizeStart + j] << (j*8) );
 							}
 							}
 							
 							
 							currentOffset = currentOffset + currentBlockSize;
 							currentOffset = currentOffset + currentBlockSize;