Jump to content

  • Log In with Google      Sign In   
  • Create Account

3D picking in OpenGL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 iONiC   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 October 2001 - 08:20 PM

I know there are several ways of doing 3d picking in OpenGL. I want to implement the color coding method, where you render the scene again (only this time using a diferent color for each object) to the back buffer, and not swapping buffers. The problem I have is with the pixel formats when getting a pixel from the buffer. I use the following code: glReadPixels(x,y,1,1,GL_RGB,GL_UNSIGNED_BYTE,(void *)pixel); When the display is set to 32bits, the code works perfect, but if the display is set to 16/8bits, I get random values, no relation to the real value at all.

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS