Requesting a new tutorial.

Started by
0 comments, last by Caste 15 years, 9 months ago
Okay, I'm very interested in learning how to use opengl mouse selection. The information on the web is very confusing to me. It would make it easier to understand if someone could modify the code from one of the existing tutorials to demonstrate this feature. I think other people would appreciate it as well. If anyone is up to the challenge, I would suggest using Lesson 5 - 3d Shape. I really don't care about what it does after the shape is selected, but there should be something to signify that it has been selected.
Advertisement
That is a good request, I think we're going to write a tutorial on that within the new series (hope you all read them [wink]). But first we want to have key input, texturing and vbos there.

But the best way to do mouse selection is the following:
- draw all selectable things in different colors ( you have 255*255*255 possibilities so that should be enough ^^)
- store a list which object is painted in what color
- perform a glReadPixels operation at the mouse position so you get the color the mouse is pointing at
- lookup which object that was
- clear all buffers
- render your scene with the common settings

This should do the trick..

Cheers
Carsten

This topic is closed to new replies.

Advertisement