We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19f41ae commit 33d5169Copy full SHA for 33d5169
scene.js
@@ -577,11 +577,20 @@ function createScene(options) {
577
//Compute camera parameters
578
579
if(cameraOptions.ortho === true) {
580
+ var Q = 0.5 * Math.pow(
581
+ Math.pow(cameraOptions.eye.x - cameraOptions.center.x, 2) +
582
+ Math.pow(cameraOptions.eye.y - cameraOptions.center.y, 2) +
583
+ Math.pow(cameraOptions.eye.z - cameraOptions.center.z, 2),
584
+ 0.5
585
+ )
586
+
587
ortho(projection,
- -0.5 * width/height, 0.5 * width/height,
- -0.5, 0.5,
- scene.zNear,
- scene.zFar
588
+ Q * -0.5 * width/height,
589
+ Q * 0.5 * width/height,
590
+ Q * -0.5,
591
+ Q * 0.5,
592
+ Q * scene.zNear,
593
+ Q * scene.zFar
594
)
595
cameraParams.ortho = true
596
} else {
0 commit comments