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

Merge pull request #18083 from WestLangley/dev_apply_matrix

BufferGeometry: properly transform normals and tangents
......@@ -140,7 +140,8 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
var normalMatrix = new Matrix3().getNormalMatrix( matrix );
normalMatrix.applyToBufferAttribute( normal );
normal.applyNormalMatrix( normalMatrix );
normal.needsUpdate = true;
}
......@@ -149,10 +150,8 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy
if ( tangent !== undefined ) {
var normalMatrix = new Matrix3().getNormalMatrix( matrix );
tangent.transformDirection( matrix );
// Tangent is vec4, but the '.w' component is a sign value (+1/-1).
normalMatrix.applyToBufferAttribute( tangent );
tangent.needsUpdate = true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册