The program I am making involves taking the image from OpenGL, and pasting them in an OpenCV window. I’m having trouble with the parts that involve lighting.
I draw a bunch of spheres, and there’s a light source, then I’m using glReadPixels like this…
char * pixels = new char[widthheight3];
glReadPixels( 0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, (void*)pixels );
This is working great… except only the shaded parts of the spheres are giving me any pixel information. The lit parts gives me null values for the color.
Any ideas?