Jump to content

  • Log In with Google      Sign In   
  • Create Account

Picking Algorithm - Unintended Results


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 twoski   Members   -  Reputation: 104

Like
0Likes
Like

Posted 08 February 2014 - 04:06 PM

I have followed several tuts about picking and i have gotten the basics figured out, however i have come across a strange issue... My picking seems to stop working randomly. I'll click directly on a vertex i want to select and it will come back with 0 hits.

I tried upping my picking tolerance to 30 which seemed rather high and it still has issues.

Here is the relevant snippet, if anyone could point out any obvious bugs i'd appreciate it!

 

Here is the relevant code 

 

http://pastebin.com/7tsuiBY0



Sponsor:

#2 richardurich   Members   -  Reputation: 1187

Like
0Likes
Like

Posted 08 February 2014 - 05:04 PM

First, you probably shouldn't use GL_SELECT. That said, I'm guessing you have to clear the screen (or at least the depth buffer). I'm guessing you're just seeing FP rounding causing your objects rendered to be behind what is already rendered and therefore not drawn. I have absolutely zero experience with GL_SELECT though, so I could very easily be wrong.

 

Did you run into trouble with the other approaches to picking? If so, I'm sure the community would gladly help you with either color-based picking (render each pickable model with a unique color, glReadPixel to see what color is at the mouse pointer) or physics-based picking (shoot a bullet from camera to mouse and collision detect).


Edited by richardurich, 08 February 2014 - 05:05 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS