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) ;

Questions:
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 MatrixGrabber.java and MatrixTrackingGL.java 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 'Kube.java' class.

On Sep 21, 7:09am, androidDeveloper <stepmas...@googlemail.com>



--~--~---------~--~----~------------~-------~--~----~



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
"com.example.android.apis.graphics.spritetext" 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.

 http://eigenclass.blogspot.com/2008/10/opengl-es-picking-using-ray-boundingbox.html 



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Key down events on answer and end call not working anymore in cupcake

*     **visit my site and earn more money**  *

*  http://latesttechnologyinfo.com/*

* ** http://latesttechnologyinfo.com/*

*  **http://latesttechnologyinfo.com/*

* ** http://latesttechnologyinfo.com/*

*  **http://latesttechnologyinfo.com/*

*  **http://latesttechnologyinfo.com/**  *

* http://latesttechnologyinfo.com/*

--~--~---------~--~----~------------~-------~--~----~

2. Radio's Colorthon Tutorial Now Available on YouTube

*     **visit my site and earn more money**  *

*  http://latesttechnologyinfo.com/*

* ** http://latesttechnologyinfo.com/*

*  **http://latesttechnologyinfo.com/*

* ** http://latesttechnologyinfo.com/*

*  **http://latesttechnologyinfo.com/*

*  **http://latesttechnologyinfo.com/**  *

* http://latesttechnologyinfo.com/*

--~--~---------~--~----~------------~-------~--~----~

3. My good god, bugs in Android brick phone, and it's not difficult to reproduce...

4. Why can "Maps" find a location on demand but not my app

5. How to get just updated screen data instead of reading all data from framebuffer?

6. How to get just updated screen data instead of reading all data from framebuffer?

7. Why can "Maps" find a location on demand but not my app