瀏覽代碼

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() ) );
 
 	}