Archived

This topic is now archived and is closed to further replies.

Rohirm

Colour Picking..

Recommended Posts

all you need to do is:

unsigned char pixels[3]; // Red, Green, Blue
glReadPixels( xcenter, ycenter, 1, 1, GL_RGB, GL_BYTE, (void*)&pixel);

this reads the pixel at ''xcenter'', ''ycenter'' and puts it in the ''pixels'' arrary.

if you want to do this from the back buffer, you have to first call:

glReadBuffer(GL_BACK);

this will read from the back buffer, but only if you have a double buffered window.

if you can''t get this to work, e-mail me at focus_business@hotmail.com, and i''ll send you the code to do it, as i had the same problem (but using mouse coordinates).

Share this post


Link to post
Share on other sites