|
@@ -10,6 +10,8 @@ THREE.PerspectiveCamera = function ( fov, aspect, near, far ) {
|
|
|
|
|
|
this.type = 'PerspectiveCamera';
|
|
this.type = 'PerspectiveCamera';
|
|
|
|
|
|
|
|
+ this.zoom = 1;
|
|
|
|
+
|
|
this.fov = fov !== undefined ? fov : 50;
|
|
this.fov = fov !== undefined ? fov : 50;
|
|
this.aspect = aspect !== undefined ? aspect : 1;
|
|
this.aspect = aspect !== undefined ? aspect : 1;
|
|
this.near = near !== undefined ? near : 0.1;
|
|
this.near = near !== undefined ? near : 0.1;
|
|
@@ -93,7 +95,7 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
|
|
if ( this.fullWidth ) {
|
|
if ( this.fullWidth ) {
|
|
|
|
|
|
var aspect = this.fullWidth / this.fullHeight;
|
|
var aspect = this.fullWidth / this.fullHeight;
|
|
- var top = Math.tan( THREE.Math.degToRad( this.fov * 0.5 ) ) * this.near;
|
|
|
|
|
|
+ var top = Math.tan( THREE.Math.degToRad( ( this.fov / this.zoom ) * 0.5 ) ) * this.near;
|
|
var bottom = - top;
|
|
var bottom = - top;
|
|
var left = aspect * bottom;
|
|
var left = aspect * bottom;
|
|
var right = aspect * top;
|
|
var right = aspect * top;
|
|
@@ -111,7 +113,7 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
- this.projectionMatrix.makePerspective( this.fov, this.aspect, this.near, this.far );
|
|
|
|
|
|
+ this.projectionMatrix.makePerspective( this.fov / this.zoom, this.aspect, this.near, this.far );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -119,10 +121,19 @@ THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
|
|
|
|
|
|
THREE.PerspectiveCamera.prototype.clone = function () {
|
|
THREE.PerspectiveCamera.prototype.clone = function () {
|
|
|
|
|
|
- var camera = new THREE.PerspectiveCamera( this.fov, this.aspect, this.near, this.far );
|
|
|
|
|
|
+ var camera = new THREE.PerspectiveCamera();
|
|
|
|
|
|
THREE.Camera.prototype.clone.call( this, camera );
|
|
THREE.Camera.prototype.clone.call( this, camera );
|
|
|
|
|
|
|
|
+ camera.zoom = this.zoom;
|
|
|
|
+
|
|
|
|
+ camera.fov = this.fov;
|
|
|
|
+ camera.aspect = this.aspect;
|
|
|
|
+ camera.near = this.near;
|
|
|
|
+ camera.far = this.far;
|
|
|
|
+
|
|
|
|
+ camera.projectionMatrix.copy( this.projectionMatrix );
|
|
|
|
+
|
|
return camera;
|
|
return camera;
|
|
|
|
|
|
};
|
|
};
|