未验证 提交 05778cff 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #20745 from Mugen87/dev

GLTFExporter: Fix normal computation with interleaved data.
......@@ -244,7 +244,7 @@ THREE.GLTFExporter.prototype = {
for ( var i = 0, il = normal.count; i < il; i ++ ) {
// 0.0005 is from glTF-validator
if ( Math.abs( v.fromArray( normal.array, i * 3 ).length() - 1.0 ) > 0.0005 ) return false;
if ( Math.abs( v.fromBufferAttribute( normal, i ).length() - 1.0 ) > 0.0005 ) return false;
}
......@@ -273,7 +273,7 @@ THREE.GLTFExporter.prototype = {
for ( var i = 0, il = attribute.count; i < il; i ++ ) {
v.fromArray( attribute.array, i * 3 );
v.fromBufferAttribute( attribute, i );
if ( v.x === 0 && v.y === 0 && v.z === 0 ) {
......@@ -286,7 +286,7 @@ THREE.GLTFExporter.prototype = {
}
v.toArray( attribute.array, i * 3 );
attribute.setXYZ( i, v.x, v.y, v.z );
}
......
......@@ -267,7 +267,7 @@ GLTFExporter.prototype = {
for ( var i = 0, il = normal.count; i < il; i ++ ) {
// 0.0005 is from glTF-validator
if ( Math.abs( v.fromArray( normal.array, i * 3 ).length() - 1.0 ) > 0.0005 ) return false;
if ( Math.abs( v.fromBufferAttribute( normal, i ).length() - 1.0 ) > 0.0005 ) return false;
}
......@@ -296,7 +296,7 @@ GLTFExporter.prototype = {
for ( var i = 0, il = attribute.count; i < il; i ++ ) {
v.fromArray( attribute.array, i * 3 );
v.fromBufferAttribute( attribute, i );
if ( v.x === 0 && v.y === 0 && v.z === 0 ) {
......@@ -309,7 +309,7 @@ GLTFExporter.prototype = {
}
v.toArray( attribute.array, i * 3 );
attribute.setXYZ( i, v.x, v.y, v.z );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册