View Full Version : how to select a rectangle with mouse

07-21-2003, 03:41 PM
I have 2 blue rectangles drawn with gl_line_loop.
if I click one of them with mouse I want it to be red. So an object selection problem.
I use ortho projection.

if you could give some sample code it would be very helpful.
Since I m extremely newbie, if you mention where should I put the code(mousedown,render?) it will would be nice for me.
Thanks for help.regards

07-22-2003, 10:55 PM
Hi !

Here is one example that use GLUT: http://www.sdsc.edu/~mjb/cse167/Handouts/Picking/picking.pdf

There are lots of others, give google a quick search and you will get lots of examples.