Selection Buffer
Is anyone out there that can help me with this? I have got something like a Solar System with a Sun and 2 planets rotating around it. Now when I click on a planet it displays some infos about it. This works fine. My problems start when I clik on a planet that is traveling over the sun (if you glRotate all the System around the X axys)!! It reads as I clicked on the Sun and not on the planet!!
Well, i found the infos about the Selection Buffer on the SuperBible at this URL: http://www.itknowledge.com/reference/archive/1571690735/ch19/594-596.html and i suppose that I can find my planet name in the buffer, but the little image that is supplied on that page is just impossible to decipher.......
Someone knows what is the format of the Selection Buffer or can give me a hand on how to solve this bug?
Thanx a lot!!!!!!!!
Magic
the selection buffer should return ALL the things under the mouse ie both the sun and the planet. what u wanna do is only ''see'' the one thats closest ie with the lesser depth buffer reading.
get the length of the vector from the camera to the planet also from camera to the sun and check which value is smaller
http://members.xoom.com/myBollux
get the length of the vector from the camera to the planet also from camera to the sun and check which value is smaller
http://members.xoom.com/myBollux
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement