diff options
Diffstat (limited to 'src/demos')
-rw-r--r-- | src/demos/com/jogamp/opengl/demos/es2/GearsES2.java | 4 | ||||
-rw-r--r-- | src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/es2/GearsES2.java b/src/demos/com/jogamp/opengl/demos/es2/GearsES2.java index 76ee32301..194397a37 100644 --- a/src/demos/com/jogamp/opengl/demos/es2/GearsES2.java +++ b/src/demos/com/jogamp/opengl/demos/es2/GearsES2.java @@ -231,9 +231,9 @@ public class GearsES2 implements StereoGLEventListener, TileRendererBase.TileRen // Use debug pipeline // drawable.setGL(new DebugGL(drawable.getGL())); - pmvMatrix = new PMVMatrix(); + pmvMatrix = new PMVMatrix(PMVMatrix.INVERSE_MODELVIEW | PMVMatrix.INVERSE_TRANSPOSED_MODELVIEW); st.attachObject("pmvMatrix", pmvMatrix); - pmvMatrixUniform = new GLUniformData("pmvMatrix", 4, 4, pmvMatrix.getSyncPMvMvitMat()); // P, Mv, Mvi and Mvit + pmvMatrixUniform = new GLUniformData("pmvMatrix", 4, 4, pmvMatrix.getSyncPMvMviMvitMat()); // P, Mv, Mvi and Mvit st.ownUniform(pmvMatrixUniform); st.uniform(gl, pmvMatrixUniform); diff --git a/src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java b/src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java index 3aa6696df..9caa4418a 100644 --- a/src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java +++ b/src/demos/com/jogamp/opengl/demos/es2/GearsObjectES2.java @@ -123,11 +123,7 @@ public class GearsObjectES2 extends GearsObject { pmvMatrix.glPushMatrix(); pmvMatrix.glTranslatef(x, y, 0f); pmvMatrix.glRotatef(angle, 0f, 0f, 1f); - if( pmvMatrix.update() ) { - st.uniform(gl, pmvMatrixUniform); - } else { - throw new InternalError("PMVMatrix.update() returns false after mutable operations"); - } + st.uniform(gl, pmvMatrixUniform); // automatic sync + update of Mvi + Mvit colorUniform.setData(gearColor); st.uniform(gl, colorUniform); |