Click here to Skip to main content
15,893,337 members
Home / Discussions / Graphics
   

Graphics

 
AnswerRe: brush problem in c#... Pin
oobimoo17-Sep-08 8:32
oobimoo17-Sep-08 8:32 
AnswerRe: brush problem in c#... Pin
Syed Mehroz Alam17-Sep-08 15:48
Syed Mehroz Alam17-Sep-08 15:48 
AnswerRe: brush problem in c#... Pin
Dan17-Sep-08 19:16
Dan17-Sep-08 19:16 
QuestionCapture Video Pin
Harvey Saayman17-Sep-08 6:18
Harvey Saayman17-Sep-08 6:18 
AnswerRe: Capture Video Pin
Tim Craig17-Sep-08 14:03
Tim Craig17-Sep-08 14:03 
AnswerRe: Capture Video Pin
Dave Kreskowiak17-Sep-08 17:14
mveDave Kreskowiak17-Sep-08 17:14 
GeneralRe: High Quality Real Vista Icons Pin
Dave Kreskowiak17-Sep-08 17:13
mveDave Kreskowiak17-Sep-08 17:13 
QuestionglReadPixels problem Pin
Tomas(cz)15-Sep-08 21:39
Tomas(cz)15-Sep-08 21:39 
Hi,
I am writing an aplication where I would like to use the method of picking the object using their id color.
I use the glReadPixels function to read the color under the cursor, but it always send back the null values. I don´t know what I am doing wrong.
Here is my sample code:

picking(int x, int y)
{
glDisable(GL_DITHER);
glDisable(GL_LIGHTING);

glClearColor(0,0,1,0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
/* drawing */
glColorub(50,50,50);
glutSolidSphere(0.7, 20, 20);

glPushMatrix();
glPushName(1);
glColor3ub(255,0,0);
glRotatef(90,0,1,0);
glutSolidCone(0.6, 4.0, 20, 20);
glPopName();
glPopMatrix();

glPushMatrix ();
glPushName(2);
glColor3ub(0,255,0);
glRotatef(-90,1,0,0);
glutSolidCone(0.6, 4.0, 20, 20);
glPopName();
glPopMatrix();

glColor3ub(0,0,255);
glPushName(3);
glutSolidCone(0.6, 4.0, 20, 20);
glPopName();

glPopMatrix();

unsigned char pixel[3];
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT,viewport);
glReadPixels(x,viewport[3]-y,1,1,GL_RGB, GL_UNSIGNED_BYTE,(void*)pixel);
/* just to see the result - always null */
byte a = pixel[0];
byte b = pixel[1];
byte c = pixel[2];
}

Thank you in advance for your help, Tomas
AnswerRe: glReadPixels problem Pin
Steve Echols17-Sep-08 19:56
Steve Echols17-Sep-08 19:56 
QuestionShoemake's Mysterious Translation Controller [modified] Pin
Steve Katic14-Sep-08 13:07
Steve Katic14-Sep-08 13:07 
Answer[Message Deleted] Pin
Steve Katic14-Sep-08 13:35
Steve Katic14-Sep-08 13:35 
GeneralRe: Shoemake's Mysterious Translation Controller (Take Two) Pin
Tim Craig14-Sep-08 14:34
Tim Craig14-Sep-08 14:34 
GeneralRe: Shoemake's Mysterious Translation Controller (Take Two) Pin
Steve Katic14-Sep-08 14:55
Steve Katic14-Sep-08 14:55 
GeneralRe: Shoemake's Mysterious Translation Controller (Take Two) [modified] Pin
Steve Katic14-Sep-08 15:13
Steve Katic14-Sep-08 15:13 
QuestionCreate real time graphical line chart from data save in txt file format Pin
yefeng_law13-Sep-08 6:52
yefeng_law13-Sep-08 6:52 
AnswerRe: Create real time graphical line chart from data save in txt file format Pin
Tim Craig13-Sep-08 12:03
Tim Craig13-Sep-08 12:03 
GeneralRe: Create real time graphical line chart from data save in txt file format Pin
yefeng_law20-Sep-08 7:15
yefeng_law20-Sep-08 7:15 
GeneralRe: Create real time graphical line chart from data save in txt file format Pin
Tim Craig21-Sep-08 18:25
Tim Craig21-Sep-08 18:25 
QuestionStrange error capturing the desktop to a bitmap Pin
rikshot13-Sep-08 5:48
rikshot13-Sep-08 5:48 
AnswerRe: Strange error capturing the desktop to a bitmap Pin
Mark Salsbery13-Sep-08 9:05
Mark Salsbery13-Sep-08 9:05 
QuestionHelp needed, DirectX 10 Sprite rendering problem Pin
Sikozu13-Sep-08 2:05
Sikozu13-Sep-08 2:05 
QuestionHow to improve drawing performance with GDI+? Pin
User 127827-Sep-08 12:44
User 127827-Sep-08 12:44 
AnswerRe: How to improve drawing performance with GDI+? Pin
Tim Craig8-Sep-08 9:57
Tim Craig8-Sep-08 9:57 
GeneralRe: How to improve drawing performance with GDI+? Pin
User 127828-Sep-08 13:10
User 127828-Sep-08 13:10 
GeneralRe: How to improve drawing performance with GDI+? Pin
Tim Craig8-Sep-08 14:25
Tim Craig8-Sep-08 14:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.