Skip to content

Commit

Permalink
include the orthographic zoom factor into the automatic zfar calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
tsturm committed Feb 15, 2017
1 parent 3d186e8 commit f67aef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nodes/Navigation/OrthoViewpoint.js
Expand Up @@ -188,8 +188,8 @@ x3dom.registerNodeType(
var dia = max.subtract(min);
var tanfov2 = Math.tan(fov / 2.0);

var dist1 = (dia.y / 2.0) / tanfov2 + dia.z;
var dist2 = (dia.x / 2.0) / tanfov2 + dia.z;
var dist1 = ( (dia.y / 2.0) / tanfov2 + dia.z ) + this._fieldOfView[2];
var dist2 = ( (dia.x / 2.0) / tanfov2 + dia.z ) + this._fieldOfView[2];

znear = 0.00001;
zfar = (dist1 > dist2) ? dist1 * 4 : dist2 * 4;
Expand Down

0 comments on commit f67aef6

Please sign in to comment.