提交 574dc64a 编写于 作者: M Mr.doob

Merge pull request #8403 from daoshengmu/fix_tga_flipY

Solve the bug of handling horizontal origin at TGA format header.
......@@ -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;
}
......
......@@ -77,7 +77,6 @@
// add box 1 - grey8 texture
var texture1 = loader.load( 'textures/crate_grey8.tga' );
texture1.flipY = true;
var material1 = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture1 } );
......@@ -89,7 +88,6 @@
// add box 2 - tga texture
var texture2 = loader.load( 'textures/crate_color8.tga' );
texture2.flipY = true;
var material2 = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture2 } );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册