Login  Register

Re: Problems with gluUnProject

Posted by Wade Walker on May 05, 2012; 11:44pm
URL: https://forum.jogamp.org/Problems-with-gluUnProject-tp3954975p3965502.html

I looked at this some more, and found that Project.__gluMultMatricesd() multiplies the matrices "backwards" from FloatUtil.multMatrixf().

It looks like ProjectFloat.java changed from using gluMultMatricesf() to FloatUtil.multMatrixf() a few weeks ago. Sven may not have realized that gluMultMatricesf() was a column-major multiply instead of a row-major multiply, so he might have switched out these methods thinking they did the same thing.

Are you using the latest autobuild of JOGL, or a recent release candidate? If so, try using an older version (one at least three months old) and see if this bad behavior goes away. If so, that will confirm that this is a recently introduced bug.

I'll try writing a unit test for gluProject and gluUnproject to nail this behavior down and make sure these functions do exactly what they're supposed to. There doesn't appear to be any test coverage for these right now, so having a few tests would definitely help.