提交 a0535a3e 编写于 作者: V Vladimir Jigouline

Fix TransformControl zoom for OrthographicCamera

上级 f61a1f64
......@@ -1166,6 +1166,10 @@ THREE.TransformControlsGizmo = function () {
handle.position.copy( this.worldPosition );
var eyeDistance = this.worldPosition.distanceTo( this.cameraPosition );
// Orthographic camera zoom doesn't depend on eyeDistance, but on camera zoom factor.
if (this.camera.type == "OrthographicCamera") {
eyeDistance = 1000 / this.camera.zoom;
}
handle.scale.set( 1, 1, 1 ).multiplyScalar( eyeDistance * this.size / 7 );
// TODO: simplify helpers and consider decoupling from gizmo
......
......@@ -1189,6 +1189,10 @@ var TransformControlsGizmo = function () {
handle.position.copy( this.worldPosition );
var eyeDistance = this.worldPosition.distanceTo( this.cameraPosition );
// Orthographic camera zoom doesn't depend on eyeDistance, but on camera zoom factor.
if (this.camera.type == "OrthographicCamera") {
eyeDistance = 1000 / this.camera.zoom;
}
handle.scale.set( 1, 1, 1 ).multiplyScalar( eyeDistance * this.size / 7 );
// TODO: simplify helpers and consider decoupling from gizmo
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册