View Full Version : 3D coordinates of a pixel

07-07-2004, 11:22 AM

I have to know all 3D coordinates which are visible in my window. Moreover, if an object is semi transparent and there is another object that I can see behind, I have to know also th e 3D coordinates of the object behind.
Do you know how I can do this ? I mean, is there an easier way to do it than ray tracing ?

thanks for your help...
I hope I post this in the good forum, nobody answered me on the beginners forum :)

07-07-2004, 05:07 PM
"Picking" may be what you want.

07-08-2004, 06:05 AM
You mean by using gluUnproject function ??
It can help but i need to have all the coordinates that are visible. I mean, if an object is semi transparent and i can see another object behind, i need also the 3D coordinates of this object behind...
this function will need the depth of this object behind to return the 3D coordinates. But i don't have this one...
or maybe can I reach multiple depth if there is transparencies in my scene ???
glReadPixel can give me multiple values for the same pixel ??

07-08-2004, 06:49 AM
afaik there is just one depth per pixel
the final image doesnt know what was transparent and what was not

07-08-2004, 06:54 AM
so I have to use picking...

I just have to know how it works know :p
can picking give me all the 3D coordinates that I need ???

07-08-2004, 08:13 AM
Aguion, this sounds like it's harder than it should be. Why do you want to know all of these coordinates? I'm guessing there's an easier way to solve your high-level problem.

07-08-2004, 10:17 AM
I'm afraid I need this coordinates. I'm working on optical flows in a 3D opengl Scene. and I need all the 3D coordinates to calculate these optical flows...


07-08-2004, 12:18 PM
I'm afraid I need this coordinates.You're not going to get them through OpenGL.

You could do something with glUnProject, up until you said you needed to get pixel coordinates through transparent objects. OpenGL does not store any of that kind of information, so your only resort is ray-tracing.