瀏覽代碼

Fix tga parsing bug of horizontal origin.

Daosheng Mu 9 年之前
父節點
當前提交
318c4ccfe7
共有 1 個文件被更改,包括 12 次插入12 次删除
  1. 12 12
      examples/js/loaders/TGALoader.js

+ 12 - 12
examples/js/loaders/TGALoader.js

@@ -390,36 +390,36 @@ THREE.TGALoader.prototype._parser = function ( buffer ) {
 				x_start = 0;
 				x_step = 1;
 				x_end = width;
-				y_start = 0;
-				y_step = 1;
-				y_end = height;
+				y_start = height - 1;
+				y_step = -1;
+				y_end = -1;
 				break;
 
 			case TGA_ORIGIN_BL:
 				x_start = 0;
 				x_step = 1;
 				x_end = width;
-				y_start = height - 1;
-				y_step = - 1;
-				y_end = - 1;
+				y_start = 0;
+				y_step = 1;
+				y_end = height;
 				break;
 
 			case TGA_ORIGIN_UR:
 				x_start = width - 1;
 				x_step = - 1;
 				x_end = - 1;
-				y_start = 0;
-				y_step = 1;
-				y_end = height;
+				y_start = height - 1;
+				y_step = -1;
+				y_end = -1;
 				break;
 
 			case TGA_ORIGIN_BR:
 				x_start = width - 1;
 				x_step = - 1;
 				x_end = - 1;
-				y_start = height - 1;
-				y_step = - 1;
-				y_end = - 1;
+				y_start = 0;
+				y_step = 1;
+				y_end = height;
 				break;
 
 		}