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. No Suitable data Network readdy error

Hi All
  i install a sipdroid on the emulator but when making a call using
the WLAN option the Error message Displayed "No suitable data network
is ready "

Some help appreciated

Thanks in advance


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

2. ListView vs ScrollView

Greetings All,

I would like to get to the bottom of the differences between ListView
and ScrollView.
I was hoping to figure out when to use each.


Could a kind person please address the following queries:

In what manner, exactly, is ListView 'optimized'?

Why would one use a ListView, instead of a ScrollView?

Why would one use a ScrollView, instead of a ListView?

. . .

Now I have read all of the Dev Guide, and have started working on my
program, I just cant figure out why I would Use the ScrollView.

Thank You for Your Time.

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

3. No WiFi, no internet?

4. Typos in 1.5 r2 DevGuide>Graphics timestamp 02 Jun 2009 12:17

5. linearlayout does not allow vertical scroll after adding dynamic edittexts

6. é©´Can an application invoke methods from other application?

7. Jollyx