Browse Source

DecalGeometry: Fix normal data.

Mugen87 6 years ago
parent
commit
f9a9f62cb0

+ 2 - 0
examples/js/geometries/DecalGeometry.js

@@ -149,6 +149,8 @@ THREE.DecalGeometry = function ( mesh, position, orientation, size ) {
 		vertex.applyMatrix4( mesh.matrixWorld );
 		vertex.applyMatrix4( mesh.matrixWorld );
 		vertex.applyMatrix4( projectorMatrixInverse );
 		vertex.applyMatrix4( projectorMatrixInverse );
 
 
+		normal.transformDirection( mesh.matrixWorld );
+
 		decalVertices.push( new THREE.DecalVertex( vertex.clone(), normal.clone() ) );
 		decalVertices.push( new THREE.DecalVertex( vertex.clone(), normal.clone() ) );
 
 
 	}
 	}

+ 2 - 0
examples/jsm/geometries/DecalGeometry.js

@@ -156,6 +156,8 @@ var DecalGeometry = function ( mesh, position, orientation, size ) {
 		vertex.applyMatrix4( mesh.matrixWorld );
 		vertex.applyMatrix4( mesh.matrixWorld );
 		vertex.applyMatrix4( projectorMatrixInverse );
 		vertex.applyMatrix4( projectorMatrixInverse );
 
 
+		normal.transformDirection( mesh.matrixWorld );
+
 		decalVertices.push( new DecalVertex( vertex.clone(), normal.clone() ) );
 		decalVertices.push( new DecalVertex( vertex.clone(), normal.clone() ) );
 
 
 	}
 	}