瀏覽代碼

OrthographicTrackballControls reinitializes object position on resize

Patrick Fuller 10 年之前
父節點
當前提交
891d96f37d
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      examples/js/controls/OrthographicTrackballControls.js

+ 6 - 0
examples/js/controls/OrthographicTrackballControls.js

@@ -84,6 +84,12 @@ THREE.OrthographicTrackballControls = function ( object, domElement ) {
 
 		this.radius = ( this.screen.width + this.screen.height ) / 4;
 
+		this.left0 = this.object.left;
+		this.right0 = this.object.right;
+		this.top0 = this.object.top;
+		this.bottom0 = this.object.bottom;
+		this.center0 = new THREE.Vector2((this.left0 + this.right0) / 2.0, (this.top0 + this.bottom0) / 2.0);
+
 	};
 
 	this.handleEvent = function ( event ) {