Преглед на файлове

DecalGeometry: Fix normal data.

Mugen87 преди 6 години
родител
ревизия
f9a9f62cb0
променени са 2 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 2 0
      examples/js/geometries/DecalGeometry.js
  2. 2 0
      examples/jsm/geometries/DecalGeometry.js

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

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