PDA

View Full Version : Sweep selection error picking object not in swept rectangle...



EricMar
10-08-2012, 06:40 PM
I have implemented a sweep rectangle, and it seems to be working ~98 % of the time...!!
( really does very good and am overall very pleased with it )

I noticed today when I was playing with the sweep selectin that I selected a set of elements and it picked the elements I did touch!
BUT, it also picked a circle element that was no where near my sweep rectangle...???

So in short, I'm not sure why it would select an element that is not even close to the sweep rectangle and not sure how you would trouble shoot it which is the big issue?
It also does report a hit on it.... like I said it shouldn't be an issue?

EricMar
10-09-2012, 01:58 PM
Interesting, I have been playing with this, and for some reason depending on the the sweep, it will add the very last rendered object to the selection list...
Eventhough it was not even close to the selection rectangle

carsten neumann
10-09-2012, 03:20 PM
Given the information you've posted I don't see how anybody would be able to help you, beyond some generic advice like: run it under a debugger, set a break point where the objects are added to the selection list and work backwards from there to find out why it adds an incorrect object.

So, unless you provide more information, you are likely to continue talking to yourself in this thread ;) ;)

EricMar
10-09-2012, 03:42 PM
After searching and testing, it ended up being an animation thread I made to test animation...


So after I rendered all my elements
then ALSO did this below:

( if I commented this bit of code, it then worked fine... so I take it it was the translate as well as the Push/Pop Matrix ) it worked fine...


glColor3f(0,0,.5);
glPushMatrix();
double move=10.0*m_iAnimate/100;
glTranslatef(move,0,0);
GLUquadric * obj=gluNewQuadric();
gluSphere( obj , 1.0*m_iAnimate/100 , 10,10);
glTranslatef(-move,0,0);
gluDeleteQuadric(obj);
glPopMatrix();