how to use gluUnProject

by Gameboy » Mon, 07 Sep 2009 23:19:37 GMT

Sponsored Links
 I'm trying to use gluUnProject for checking touch selection on a 3D
object, but seems I can not do with current 1.5 emulator.

The method needs to know current viewport, model view matrix and
project matrix, I'm trying to use G11 gl to query but get nothing with
below codes:

int[] viewport = new int[4] ;
gl.glGetIntegerv(GL11.GL_VIEWPORT, viewport, 0) ;
float[] modelview = new float[16] ;
gl.glGetFloatv(gl.GL_MODELVIEW_MATRIX, modelview, 0) ;
float[] project = new float[16] ;
gl.glGetFloatv(gl.GL_PROJECTION_MATRIX, project, 0) ;

1) Is there other way to get these params?
2) Does current 1.5 emulator support these G11 feature?

how to use gluUnProject

by Streets Of Boston » Tue, 08 Sep 2009 21:54:50 GMT

 Look for and in the 'API
Demoes' that comes with the Android SDK.


Sponsored Links

how to use gluUnProject

by androidDeveloper » Mon, 21 Sep 2009 19:11:08 GMT

 Have you checked the MatrixGrabber?

I tried to use the MatrixGrabber, but I got an class Cast Exception in
the MatrixGrabber Row 56:
    private void getMatrix(GL10 gl, int mode, float[] mat) {
        MatrixTrackingGL gl2 = (MatrixTrackingGL) gl;

Does anyone know how to use it?


how to use gluUnProject

by Streets Of Boston » Mon, 21 Sep 2009 20:59:02 GMT

 Be sure that the 'gl' you use in your app is actually a
MatrixTrackingGL, a wrapper around the GL10 instance returned by the
opengl api.

Look at the API Demoes source code that comes with the Android SDK.
Look at the '' class.

On Sep 21, 7:09am, androidDeveloper <>


how to use gluUnProject

by androidDeveloper » Mon, 21 Sep 2009 22:10:50 GMT

 Thanks. I found the error. The Code example is found in the ApiDemos
"" SpriteTextActivity.


how to use gluUnProject

by Robert Green » Tue, 22 Sep 2009 05:14:31 GMT

 If you want to pick a rendered object, just check for collisions with
a primitive bounding box and a casted ray.

1)  Keep a copy of the matrix you use for the projection.
2)  Implement this, using that matrix that you kept.

For iPhone but easily portable to Android, so long as you know that
you can't get the projection matrix normally. 


Other Threads

1. Cant a service talk to other service

Hi android devels,

In the Android app frame work there are 4 basic blocks,
activities and services, broadcast recievers and content providers.

Now i have done some work on activity talkting to service.
Now i would like to know,

Is it possible for a service to talk to other service.
If possible Can any one show me where to start.

(: Naveen Krishna Ch :)


2. sync error -- local changes


I am trying to sync with repo. I have done the sync for last march 5th
(first time). After that I build the source many time and today I
tried to sync with the repo. But I got the local changes error. This
is the error I got when I sync with the repo. Can any one tell me how
to resolve this.

 subcmds/        |   11 ++-
 subcmds/          |   85 ++++++++++++-----
 subcmds/        |    3 -
 18 files changed, 919 insertions(+), 127 deletions(-)
 create mode 100644
 create mode 100644 subcmds/
 create mode 100644 subcmds/
 create mode 100644 subcmds/
 create mode 100644 subcmds/
info: Restarting repo with latest version
Fetching projects: 100% (114/114), done.
Syncing work tree:  40% (45/112)  error: You have local changes to
'tools_v2/build/make/'; cannot switch branches.

Thanks in advance,

3. bottom Tabview

4. Performance test cases

5. Writing PerformanceTestCases

6. SDK 1.5 on VISTA - start emulator with no success

7. Can't use the findViewById() in an second view