diff options
author | Sven Gothel <sgothel@jausoft.com> | 2012-11-12 04:28:51 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2012-11-12 04:28:51 +0100 |
commit | 6f22805273d63d3b6f0449f34c0acb5edec285db (patch) | |
tree | cbe6e16f491931221864f241f534dc3b620de6da /src/jogl/classes/com/jogamp/opengl/util | |
parent | 26bdab54bdf877ea4d9fd8f42317889279706926 (diff) |
Validating Frustum w/ help of Eduard White olamedia@gmail.com, referencing the original paper
Paper:
Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix
http://graphics.cs.ucf.edu/cap4720/fall2008/plane_extraction.pdf
Authors (in alphabetical order):
Gil Gribb <ggribb@ravensoft.com>
Klaus Hartmann <k_hartmann@osnabrueck.netsurf.de>
06/15/2001
Fix:
- Column Major Order PMV (Passing to Frustum and in calculation itself) according to paper coeff. calculation of plane
- Plane's signed distance function (only add d, don't multiply)
- Normalization: divide by lenght, not multiply
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java index 237596a81..19d877bab 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java +++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java @@ -275,7 +275,7 @@ public class PMVMatrix implements GLMatrixFunc { requestMask = 0; matrixMode = GL_MODELVIEW; - mulMVP = null; + mulPMV = null; frustum = null; } @@ -1040,10 +1040,10 @@ public class PMVMatrix implements GLMatrixFunc { if( 0 != ( dirtyBits & ( DIRTY_FRUSTUM & requestMask ) ) ) { if( null == frustum ) { frustum = new Frustum(); - mulMVP = new float[16]; + mulPMV = new float[16]; } - FloatUtil.multMatrixf(matrixMv, matrixP, mulMVP, 0); - frustum.update(mulMVP, 0); + FloatUtil.multMatrixf(matrixMv, matrixP, mulPMV, 0); + frustum.update(mulPMV, 0); dirtyBits &= ~DIRTY_FRUSTUM; mod = true; } @@ -1128,6 +1128,6 @@ public class PMVMatrix implements GLMatrixFunc { protected int dirtyBits = DIRTY_ALL; // contains the dirty bits, i.e. hinting for update operation protected int requestMask = 0; // may contain the requested dirty bits: DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW protected ProjectFloat projectFloat; - protected float[] mulMVP; // premultiplied PMV + protected float[] mulPMV; // premultiplied PMV protected Frustum frustum; } |