diff options
author | Sven Gothel <[email protected]> | 2023-03-21 14:16:00 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-21 14:16:00 +0100 |
commit | 74e11bd9a49f61e49d3c73c4f9b87b4fb7fbaaf3 (patch) | |
tree | d81d07f0a3190b2cb0e19b3a61883f6162eddcdd /src/graphui | |
parent | 1cbe45b9d7f21a751332d6f8dd948992e75dfe99 (diff) |
GraphUI: Fix Scene.PMVMatrixSetup impl: Setup modelview before using setPlanBox(..)'s gluUnProject(..)
Diffstat (limited to 'src/graphui')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java b/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java index 0755b31b9..39039d83d 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java +++ b/src/graphui/classes/com/jogamp/graph/ui/gl/Scene.java @@ -942,16 +942,18 @@ public final class Scene implements GLEventListener { pmv.gluPerspective(DEFAULT_ANGLE, ratio, DEFAULT_ZNEAR, DEFAULT_ZFAR); pmv.glTranslatef(0f, 0f, DEFAULT_SCENE_DIST); + pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); + pmv.glLoadIdentity(); + // Scale (back) to have normalized plane dimensions, 1 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, sxy, 1f); - pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); - pmv.glLoadIdentity(); } @Override |