Browse Source

created _m33 class member (moved out of Matrix4) and modified THREE.Matrix4.makeInvert3x3() call accordingly, as with WebGLRenderer

astrodud 14 years ago
parent
commit
6a5ad65104
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/renderers/WebGLRenderer2.js

+ 3 - 1
src/renderers/WebGLRenderer2.js

@@ -68,6 +68,8 @@ THREE.WebGLRenderer2 = function ( antialias ) {
 
 	};
 
+	this._m33 = new THREE.Matrix3();
+
 	this.render = function( scene, camera ) {
 
 		var o, ol;
@@ -113,7 +115,7 @@ THREE.WebGLRenderer2 = function ( antialias ) {
 			_modelViewMatrix.multiply( camera.matrix, object.matrix );
 			_modelViewMatrixArray.set( _modelViewMatrix.flatten() );
 
-			_normalMatrix = THREE.Matrix4.makeInvert3x3( _modelViewMatrix ).transpose();
+			_normalMatrix = THREE.Matrix4.makeInvert3x3( _modelViewMatrix, this._m33 ).transpose();
 			_normalMatrixArray.set( _normalMatrix.m );
 
 			if ( object instanceof THREE.Mesh ) {