how can i read an RGBA value off a point on the surface of a polygon?

I thought about using glreadpixels, but it only lets you read a rectangular region in two dimensional space. I need a method that will yield the RGBA value for any point on any surface of any polygon anywhere in 3d space.

I’m stuck. Any help is much appreciated.


You can project the point on the polygon to screen coordinates using gluProject. Then use glReadPixels with the coordinates you get from gluProject to get the RGBA-value.

do a search in the forum on picking…