2
0
Эх сурвалжийг харах

Raycaster: correct ray origin in SetFromCamera() (#9098)

WestLangley 9 жил өмнө
parent
commit
578978c2f5
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      src/core/Raycaster.js

+ 1 - 1
src/core/Raycaster.js

@@ -84,7 +84,7 @@
 
 			} else if ( camera instanceof THREE.OrthographicCamera ) {
 
-				this.ray.origin.set( coords.x, coords.y, - 1 ).unproject( camera );
+				this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera
 				this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );
 
 			} else {