hmm, thanks a lot for replies from both of you!

It's surprising though that gluUnProject didn't work.

There is a comment in MatrixTrackingGL.java

 * Note: the actual matrix may differ from the retrieved matrix, due
 * to differences in the way the math is implemented by
GLMatrixWrapper
 * as compared to the way the math is implemented by the OpenGL ES
 * driver.

Maybe that's why?

On Feb 26, 8:59 am, Streets Of Boston <flyingdutc...@gmail.com> wrote:
> I had similar issues:
> - Where to obtain the model-view and the project-view matrices.
> - gluUnProject did not seem to work... it returned results i did not
> expect.
>
> I solved these issues:
> - I borrowed code from the MatrixGrabber.java you can find in the "API
> Demos" examples. This class contains methods to obtain the project and
> model view matrices.
> - I wrote my own gluUnProject, based upon a C-implementation i found
> on the internet.
>
> Gotohttp://soft.antonspaans.comand leave me a message there and i
> can send you the java source code for gluUnProject.
>
> On Feb 24, 8:10 pm, focuser <linto...@gmail.com> wrote:
>
> > Hi,
>
> > I'm trying to convert window coordinates to object coordinates.
> > There's a gluUnProject in GLU class, which requires current modelview,
> > projection matrices and viewport.
>
> > My question is how to get those matrices?  I tried gl.glGetIntegerv
> > (GL11.GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES, model, 0); and
> > ((GL11) gl).glGetFloatv(GL11.GL_MODELVIEW_MATRIX, modelf, 0);
>
> > but the first one returns an array of zeros, and the other one just
> > shows an "method not implemented" error.
>
> > Is gluUnProject the correct method for this purpose (i.e. window
> > coordinates --> object coordinates) ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to