[android-developers] Re: Incorrect output values with gluUnProject… why?

2011-11-08 Thread saex
I'm checking your code, but i still have the same problem with your code żwich winZ value i have to pass to your function? how to get that Z value? Please answer :/ On Nov 8, 1:39 am, Streets Of Boston flyingdutc...@gmail.com wrote: I experienced similar issues with gluUnProject. I wrote my

[android-developers] Re: Incorrect output values with gluUnProject… why?

2011-11-08 Thread saex
also, your function is giving me NaN allways :S 01-04 17:18:11.334: DEBUG/X(2887): X: NaN 01-04 17:18:11.334: DEBUG/X(2887): Y: NaN 01-04 17:18:11.334: DEBUG/X(2887): Z: NaN On Nov 8, 1:39 am, Streets Of Boston flyingdutc...@gmail.com wrote: I experienced similar issues

[android-developers] Re: Incorrect output values with gluUnProject… why?

2011-11-08 Thread Streets Of Boston
In your 3D model, you have two Z values (for depth). Z-near (the 'location' of your screen) and Z-far (the furthest z-plane of your 3D model). The user touches the screen and Xs, Ys. Now call gluUnProject twice: gluUnProject(xWin, ((float)screenH)-yWin, *zNear*, modelMatrix, 0, projMatrix, 0,

[android-developers] Re: Incorrect output values with gluUnProject… why?

2011-11-08 Thread saex
isn't exist a easiest way to do it...? i think i need a little help with that algorithm On Nov 8, 4:03 pm, Streets Of Boston flyingdutc...@gmail.com wrote: In your 3D model, you have two Z values (for depth). Z-near (the 'location' of your screen) and Z-far (the furthest z-plane of your 3D

[android-developers] Re: Incorrect output values with gluUnProject… why?

2011-11-08 Thread Streets Of Boston
Nothing comes easy. :-) Google it. Open up your geometry books. Do whatever is necessary to make it happen. The information is out there and you can learn it and apply it to your app. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post

[android-developers] Re: Incorrect output values with gluUnProject… why?

2011-11-07 Thread saex
Yes Latimerius, i think that i dont have to pass 0 as winZ parameter, but i dont know how to get the Z value from the depth buffer. I'm programming for Android 1.5 and openGL ES1, i didn't find a working way to obtain winZ value on google after hours of searching :( Did you know how to do it?

Re: [android-developers] Re: Incorrect output values with gluUnProject… why?

2011-11-07 Thread Latimerius
On Mon, Nov 7, 2011 at 6:01 PM, saex elpablos...@gmail.com wrote: Yes Latimerius, i think that i dont have to pass 0 as winZ parameter, but i dont know how to get the Z value from the depth buffer. I'm programming for Android 1.5 and openGL ES1, i didn't find a working way to obtain winZ value

Re: [android-developers] Re: Incorrect output values with gluUnProject… why?

2011-11-07 Thread Romain Guy
OpenGL ES (1.0 and 2.0) does not offer a way to read the depth buffer. You can fake it in 2.0 by using a custom shader to render the scene in an FBO. Here's the fragment shader I've used in the past to achieve this: // uniform float UNI_near; // uniform float UNI_far; void main() { //

[android-developers] Re: Incorrect output values with gluUnProject… why?

2011-11-07 Thread Streets Of Boston
I experienced similar issues with gluUnProject. I wrote my own implementation. I posted it on this board a few years ago: https://groups.google.com/d/msg/android-developers/nSv1Pjp5jLY/wX9QEe6jzwcJ -- You received this message because you are subscribed to the Google Groups Android Developers