From 093bc6cde6211cbf544bfa29889e9f00e09cf23d Mon Sep 17 00:00:00 2001 From: codeanticode Date: Sun, 20 Oct 2013 00:51:41 -0400 Subject: [PATCH] complete scaling/translations when the shape is 3D --- core/src/processing/opengl/PShapeOpenGL.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/core/src/processing/opengl/PShapeOpenGL.java index 466f2ba51..bd72ffe85 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/core/src/processing/opengl/PShapeOpenGL.java @@ -1160,7 +1160,11 @@ public class PShapeOpenGL extends PShape { @Override public void translate(float tx, float ty) { - transform(TRANSLATE, tx, ty); + if (is3D) { + transform(TRANSLATE, tx, ty, 0); + } else { + transform(TRANSLATE, tx, ty); + } } @@ -1202,13 +1206,21 @@ public class PShapeOpenGL extends PShape { @Override public void scale(float s) { - transform(SCALE, s, s); + if (is3D) { + transform(SCALE, s, s, s); + } else { + transform(SCALE, s, s); + } } @Override public void scale(float x, float y) { - transform(SCALE, x, y); + if (is3D) { + transform(SCALE, x, y, 1); + } else { + transform(SCALE, x, y); + } }