summaryrefslogtreecommitdiffstats
path: root/src/demos
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos')
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java6
-rw-r--r--src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java
index 007a5403b..cac6fe77e 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo01.java
@@ -191,16 +191,18 @@ public class UISceneDemo01 {
pmv.gluPerspective(Scene.DEFAULT_ANGLE, ratio, Scene.DEFAULT_ZNEAR, Scene.DEFAULT_ZFAR);
pmv.glTranslatef(0f, 0f, Scene.DEFAULT_SCENE_DIST);
+ pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+ pmv.glLoadIdentity();
+
// Scale (back) to have normalized plane dimensions, 100 for the greater of width and height.
final AABBox planeBox0 = new AABBox();
setPlaneBox(planeBox0, pmv, x, y, width, height);
final float sx = planeBox0.getWidth();
final float sy = planeBox0.getHeight();
final float sxy = sx > sy ? sx : sy;
+ pmv.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmv.glScalef(sxy / 100f, sxy / 100f, 1f);
-
pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
- pmv.glLoadIdentity();
}
@Override
diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java
index 6cd5a9b76..433521933 100644
--- a/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java
+++ b/src/demos/com/jogamp/opengl/demos/graph/ui/UISceneDemo20.java
@@ -1092,13 +1092,15 @@ public class UISceneDemo20 implements GLEventListener {
pmv.gluPerspective(Scene.DEFAULT_ANGLE, ratio, Scene.DEFAULT_ZNEAR, Scene.DEFAULT_ZFAR);
pmv.glTranslatef(0f, 0f, Scene.DEFAULT_SCENE_DIST);
+ pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+ pmv.glLoadIdentity();
+
// Translate origin to bottom-left
final AABBox planeBox0 = new AABBox();
setPlaneBox(planeBox0, pmv, x, y, width, height);
+ pmv.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
pmv.glTranslatef(planeBox0.getMinX(), planeBox0.getMinY(), 0f);
-
pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
- pmv.glLoadIdentity();
}
@Override