diff --git a/src/webgl/p5.Camera.js b/src/webgl/p5.Camera.js index 5d9f44c2c2..b15cfd47cd 100644 --- a/src/webgl/p5.Camera.js +++ b/src/webgl/p5.Camera.js @@ -912,7 +912,7 @@ p5.Camera = class Camera { if (top === undefined) top = +this._renderer.height / 2; if (near === undefined) near = 0; if (far === undefined) - far = Math.max(this._renderer.width, this._renderer.height); + far = Math.max(this._renderer.width, this._renderer.height)+800; this.cameraNear = near; this.cameraFar = far; diff --git a/test/unit/webgl/p5.Camera.js b/test/unit/webgl/p5.Camera.js index 0704a64728..aa682d0c11 100644 --- a/test/unit/webgl/p5.Camera.js +++ b/test/unit/webgl/p5.Camera.js @@ -650,12 +650,12 @@ suite('p5.Camera', function() { assert.deepEqual(myCam.projMatrix.mat4, expectedMatrix); }); - test('ortho() with no parameters specified (sets default)', function() { + test('ortho() with no parameters specified (sets default with added far)', function() { var expectedMatrix = new Float32Array([ 0.019999999552965164, 0, 0, 0, - 0, -0.019999999552965164, 0,0, - 0,0,-0.019999999552965164,0, - -0,-0,-1,1 + 0, -0.019999999552965164, 0, 0, + 0, 0, -0.002222222276031971, 0, + -0, -0, -1, 1 ]); myCam.ortho(); assert.deepEqual(myCam.projMatrix.mat4, expectedMatrix);