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. Emulate binary port SMS?


Is there a way to emulate binary port SMS with DDMS or anything else?


----- Original Message ----- 
From: "hackbod" <[EMAIL PROTECTED]>
To: "Android Developers" <>
Sent: Friday, November 14, 2008 12:39 AM
Subject: [android-developers] Re: G1- No animated transitions between 

The emulator and device are exactly the same in this regard.  By
default the activity transitions are not turned on; you must have run
something (like Dev Tools) on the emulator that give you the option to
turn them on.  The reason they aren't on by default is that there were
still a few issues with them in 1.0.


2. Interested in LBS & AR? Android Developer Needed

Looking for an Android developer to join our mobile development team.
Feel at home on Facebook & Twitter? Like tackling tough groundbreaking
problems? Interested in location based services & augmented reality?
We like to meet you!

What can we provide to you? A decent hourly rate, a flexible schedule.
Must be able work at least part-time from our Denver offices.

If youe interested, send us an email: [EMAIL PROTECTED]

Learn more about us at


3. Accelerometer sensitivity: very very high?

4. Check for new version of applications

5. How can I setup my development environment to take picture via android camera

6. Map Frustrations

7. Switching between GPS providers