diff options
author | Sven Gothel <[email protected]> | 2023-09-02 20:24:23 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-09-02 20:24:23 +0200 |
commit | 71576e94af890e2a4a98225ed258445ba7db0f26 (patch) | |
tree | 2e07d6a18f7394d394459a98414ad8c16984d0ed /src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java | |
parent | f6dd8e9562d7e0bbf681c268f40ff4c819057915 (diff) |
PMVMatrix.gluPerspective(): Redfine angle in radians instead of degrees ** API Change **
Since this is an extra implementation of PMVMatrix and not of GLMatrixFunc, we shall use the default ISO dimension avoiding conversion.
This alsi redefined Graph's RegionRenderer.reshapePerspective() angle definition from degrees to radians
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java index 8b3fb3a82..0c939d015 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java @@ -362,17 +362,29 @@ public final class RegionRenderer { viewport.set(x, y, width, height); } - public final void reshapePerspective(final float angle, final int width, final int height, final float near, final float far) { + /** + * Perspective projection, method also calls {@link #reshapeNotify(int, int, int, int)}. + * @param angle_rad perspective angle in radians + * @param width viewport width + * @param height viewport height + * @param near projection z-near + * @param far projection z-far + */ + public final void reshapePerspective(final float angle_rad, final int width, final int height, final float near, final float far) { reshapeNotify(0, 0, width, height); final float ratio = (float)width/(float)height; final PMVMatrix p = getMatrix(); p.glMatrixMode(GLMatrixFunc.GL_PROJECTION); p.glLoadIdentity(); - p.gluPerspective(angle, ratio, near, far); + p.gluPerspective(angle_rad, ratio, near, far); } /** - * Perspective orthogonal, method calls {@link #reshapeNotify(int, int, int, int)}. + * Orthogonal projection, method also calls {@link #reshapeNotify(int, int, int, int)}. + * @param width viewport width + * @param height viewport height + * @param near projection z-near + * @param far projection z-far */ public final void reshapeOrtho(final int width, final int height, final float near, final float far) { reshapeNotify(0, 0, width, height); |