提交 a0b9d91a 编写于 作者: C Chabam

Using a check for the NDC space instead

上级 3c4e6217
...@@ -36,7 +36,6 @@ THREE.CSS2DRenderer = function () { ...@@ -36,7 +36,6 @@ THREE.CSS2DRenderer = function () {
var vector = new THREE.Vector3(); var vector = new THREE.Vector3();
var viewMatrix = new THREE.Matrix4(); var viewMatrix = new THREE.Matrix4();
var viewProjectionMatrix = new THREE.Matrix4(); var viewProjectionMatrix = new THREE.Matrix4();
var frustum = new THREE.Frustum();
var cache = { var cache = {
objects: new WeakMap() objects: new WeakMap()
...@@ -83,7 +82,7 @@ THREE.CSS2DRenderer = function () { ...@@ -83,7 +82,7 @@ THREE.CSS2DRenderer = function () {
element.style.MozTransform = style; element.style.MozTransform = style;
element.style.oTransform = style; element.style.oTransform = style;
element.style.transform = style; element.style.transform = style;
element.style.display = frustum.containsPoint( object.position ) ? '' : 'none'; element.style.display = ( vector.z < - 1 || vector.z > 1 ) ? 'none' : '';
var objectData = { var objectData = {
distanceToCameraSquared: getDistanceToSquared( camera, object ) distanceToCameraSquared: getDistanceToSquared( camera, object )
...@@ -166,7 +165,6 @@ THREE.CSS2DRenderer = function () { ...@@ -166,7 +165,6 @@ THREE.CSS2DRenderer = function () {
viewMatrix.copy( camera.matrixWorldInverse ); viewMatrix.copy( camera.matrixWorldInverse );
viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, viewMatrix ); viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, viewMatrix );
frustum.setFromMatrix( viewProjectionMatrix );
renderObject( scene, camera ); renderObject( scene, camera );
zOrder( scene ); zOrder( scene );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册