Ver Fonte

Corrected near/far plane clipping logic in CanvasRenderer.

WestLangley há 12 anos atrás
pai
commit
71223194e4
2 ficheiros alterados com 4 adições e 2 exclusões
  1. 2 1
      build/three.js
  2. 2 1
      src/core/Projector.js

+ 2 - 1
build/three.js

@@ -6434,8 +6434,9 @@ THREE.Projector = function() {
 
 
 					_vertex.positionScreen.x /= _vertex.positionScreen.w;
 					_vertex.positionScreen.x /= _vertex.positionScreen.w;
 					_vertex.positionScreen.y /= _vertex.positionScreen.w;
 					_vertex.positionScreen.y /= _vertex.positionScreen.w;
+					_vertex.positionScreen.z /= _vertex.positionScreen.w;
 
 
-					_vertex.visible = _vertex.positionScreen.z > near && _vertex.positionScreen.z < far;
+					_vertex.visible = _vertex.positionScreen.z > -1 && _vertex.positionScreen.z < 1;
 
 
 				}
 				}
 
 

+ 2 - 1
src/core/Projector.js

@@ -234,8 +234,9 @@ THREE.Projector = function() {
 
 
 					_vertex.positionScreen.x /= _vertex.positionScreen.w;
 					_vertex.positionScreen.x /= _vertex.positionScreen.w;
 					_vertex.positionScreen.y /= _vertex.positionScreen.w;
 					_vertex.positionScreen.y /= _vertex.positionScreen.w;
+					_vertex.positionScreen.z /= _vertex.positionScreen.w;
 
 
-					_vertex.visible = _vertex.positionScreen.z > near && _vertex.positionScreen.z < far;
+					_vertex.visible = _vertex.positionScreen.z > -1 && _vertex.positionScreen.z < 1;
 
 
 				}
 				}