Advertisement Jump to content
Sign in to follow this  

OpenGL Question about picking

This topic is 3855 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm reading tutorials about picking and selecting of objects in openGL and it reads that this is done by naming and GL_SELECT rendering of objects. The list of hits is then stored in a buffer with hit's depth. It is also said that the selected object is the one closes to the viewer. (camera) But here's the question. What happens when 2 or more objects are in the same distance from the camera? Also I have 2 glspheres posistioned 5,5,0 and 10,10,0. Initialized like this
for (int c=0;c<2;c++)
Hit is detected for each object but no data is in buffer. What did I do wrong?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!