瀏覽代碼

Changed TransformControls scaling factor implementation.

Aki Rodic 5 年之前
父節點
當前提交
f5a09b6a6b
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      examples/js/controls/TransformControls.js
  2. 1 1
      examples/jsm/controls/TransformControls.js

+ 1 - 1
examples/js/controls/TransformControls.js

@@ -1173,7 +1173,7 @@ THREE.TransformControlsGizmo = function () {
 
 
 			} else {
 			} else {
 
 
-				factor = this.worldPosition.distanceTo( this.cameraPosition ) * Math.min( 1.9 * Math.tan( Math.PI * this.camera.getEffectiveFOV() / 360 ), 7 );
+				factor = this.worldPosition.distanceTo( this.cameraPosition ) * Math.min( 1.9 * Math.tan( Math.PI * this.camera.fov / 360 ) / this.camera.zoom, 7 );
 
 
 			}
 			}
 
 

+ 1 - 1
examples/jsm/controls/TransformControls.js

@@ -1196,7 +1196,7 @@ var TransformControlsGizmo = function () {
 
 
 			} else {
 			} else {
 
 
-				factor = this.worldPosition.distanceTo( this.cameraPosition ) * Math.min( 1.9 * Math.tan( Math.PI * this.camera.getEffectiveFOV() / 360 ), 7 );
+				factor = this.worldPosition.distanceTo( this.cameraPosition ) * Math.min( 1.9 * Math.tan( Math.PI * this.camera.fov / 360 ) / this.camera.zoom, 7 );
 
 
 			}
 			}