How often to pick

Started by
3 comments, last by Mantear 18 years, 8 months ago
Greetings, I've been working on the GUI for my program, and came across something I'm sure others have delt with before. Several different mouse events can cause actions to take place. In my case, a left mouse click causes the picking scene to be rendered and then processed. If the mouse click is being held down and the mouse moves, again the picking scene is rendered, but a different processing function is called to handle what should happen on a click held + mouse move. However, if I go just based off of mouse movement messages from the Windows message callback, I feel like I'm rendering the picking scene far too many times. However, if I don't do that and put some minimum time between rending of the picking scene, I could miss the user dragging the mouse over something. I have very, very few items being drawn right now, so the drop in FPS is most likely missleading (I'm probably taking the largest hit just switching rendering modes). But I thought I'd see how others handle such things. Thanks for any input.
Advertisement
It would be good to organise it so that you only need to pick when you get a mousedown event. Is there some reason you need to render the picking scene when mouse button is already down and the mouse moves?
Yes. If the user clicks down, dragging the mouse over items while the click is held down can also select items.
gluPickMatrix(..) or pickregion or something lets u define a onscreen rectange to select objects within
I want it to be interactive/realtime. If the user clicks on an object and holds, then moves the mouse over other objects, it needs to respond. A quick example would be selecting multiple objects at once. So I can't just define a region and process a single picking event.

This topic is closed to new replies.

Advertisement