diff --git a/core/src/processing/opengl/PGraphics2D.java b/core/src/processing/opengl/PGraphics2D.java index c781c379e..509a6f909 100644 --- a/core/src/processing/opengl/PGraphics2D.java +++ b/core/src/processing/opengl/PGraphics2D.java @@ -120,7 +120,7 @@ public class PGraphics2D extends PGraphicsOpenGL { @Override protected void defaultPerspective() { - super.ortho(0, width, height, 0, -1, +1); + super.ortho(0, width, 0, height, -1, +1); } diff --git a/core/src/processing/opengl/PGraphics3D.java b/core/src/processing/opengl/PGraphics3D.java index c214d0c2c..1924206bd 100644 --- a/core/src/processing/opengl/PGraphics3D.java +++ b/core/src/processing/opengl/PGraphics3D.java @@ -85,7 +85,7 @@ public class PGraphics3D extends PGraphicsOpenGL { @Override protected void begin2D() { pushProjection(); - ortho(0, width, height, 0, -1, +1); + ortho(0, width, 0, height, -1, +1); pushMatrix(); camera(width/2, height/2); } diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index d47b86136..dab31340c 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -4054,7 +4054,7 @@ public class PGraphicsOpenGL extends PGraphics { */ @Override public void ortho() { - ortho(0, width, height, 0, cameraNear, cameraFar); + ortho(0, width, 0, height, cameraNear, cameraFar); } @@ -4094,10 +4094,10 @@ public class PGraphicsOpenGL extends PGraphics { float tz = -(far + near) / (far - near); // The minus sign is needed to invert the Y axis. - projection.set(x, 0, 0, tx, - 0, y, 0, ty, - 0, 0, z, tz, - 0, 0, 0, 1); + projection.set(x, 0, 0, tx, + 0, -y, 0, ty, + 0, 0, z, tz, + 0, 0, 0, 1); calcProjmodelview(); @@ -4140,7 +4140,7 @@ public class PGraphicsOpenGL extends PGraphics { float ymin = -ymax; float xmin = ymin * aspect; float xmax = ymax * aspect; - frustum(xmin, xmax, ymax, ymin, zNear, zFar); + frustum(xmin, xmax, ymin, ymax, zNear, zFar); } @@ -4161,10 +4161,10 @@ public class PGraphicsOpenGL extends PGraphics { float h = top - bottom; float d = zfar - znear; - projection.set(n2 / w, 0, (right + left) / w, 0, - 0, n2 / h, (top + bottom) / h, 0, - 0, 0, -(zfar + znear) / d, -(n2 * zfar) / d, - 0, 0, -1, 0); + projection.set(n2 / w, 0, (right + left) / w, 0, + 0, -n2 / h, (top + bottom) / h, 0, + 0, 0, -(zfar + znear) / d, -(n2 * zfar) / d, + 0, 0, -1, 0); calcProjmodelview();