How can i get the RGB values at the vertex in the corners of a triangle?
actually it should be the color you defined with glColor3f(…)- unless you enable lighting, for example.
to get the displayed color, you should
-
use gluProject(…) to get the vertex position on the screen.
-
use glReadPixels(…) to read the color buffer at this position.