First of all i should explain the exemple-program that i’m trying to do, or what i have so far.
I’m trying to make a User Interface, so i can choose variables (as a player picking speels or using buttons).
So far i made a scroll bar(already working fine, although not using picking) and 3 simple buttons, as you can see:
But the buttons i wanted to use picking, I had no idea how to do this so i went searching and i found this picking metod: http://gpwiki.org/index.php/OpenGL:Tutorials:Picking
Although i dont know if it is the most correct for what i want… anyway, when picking 3D objects the code works wonderfull, although when it comes to pick what im drowing directly in my projection matrix it just says that ive clicked in all objects.
i.e. if i name botton’s 1, 2 and 3, it says that i picked all of the 3. In other words, he thinks that i clicked everything in my projection matrix.
as you can see in the image, all buttons were clicked :c and as you can see in the first image, the 3 buttons are quite separated(the red, yellow and blue squares). The other numbers that appear are for other objects in the way, like the floor and the mouse.
I’d apressiate any help.