Mouse Over picking
I was wondering how you do mouse overs in your game. I had first tried rendering the scene into the select buffer (the same way that I do for mouse clicks) but this is way to slow to do for every mouse move.
I was thinking about using the feedback buffer to get window coordinates of the objects that I want to do mouse over testing for, then handle it with bounding squares in 2D. Maybe I could render into the feedback buffer less frequently if the objects I want to mouse over arn''t moving... (ie, a grid square).. I would have to redo this everytime the camera moved...
This would be used for things like highlighting a grid square when the user is supposed to select a destination square in a tile based game. Or for a menu to highlight options as the mouse passes over them.
If there is a better way to do this, please let me know!
Thanks
Ickno
You could project the mouse coordinates in 3d, and do a raytracing/raycasting check to see what it hits. I beleive this is VERY simple when working with a grid array (aka, height map type deal).
I havent tried to do anything quite like that yet but you might get away with using the select buffer except when in selection mode only render the things that you can potentially click on. It should speed things up quite a bit but you''ll get side effects. Like if you check if you can click on an object that is behinds something you would still be able to click on it because you didn''t render all polys on the select buffer... but its just an idea...
I'm don't know much but I can try to help... just email me at... Shadow_0f_Light@Yahoo.com(the '0' in 'Of' is a zero :P)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement