Garrett Johnson 5 سال پیش
والد
کامیت
ace06f70ef
1فایلهای تغییر یافته به همراه9 افزوده شده و 4 حذف شده
  1. 9 4
      example/index.js

+ 9 - 4
example/index.js

@@ -194,10 +194,15 @@ function onMouseMove( e ) {
 	if ( results.length ) {
 
 		const closestHit = results[ 0 ];
-		rayIntersect.position.copy( closestHit.point );
-
-		closestHit.face.normal.add( closestHit.point );
-		rayIntersect.lookAt( closestHit.face.normal );
+		const point = closestHit.point;
+		const normal = closestHit.face.normal;
+
+		rayIntersect.position.copy( point );
+		rayIntersect.lookAt(
+			point.x + normal.x,
+			point.y + normal.y,
+			point.z + normal.z
+		);
 
 	}