View Full Version : issue with selection
05-15-2004, 09:58 AM
I am having an issue with my simple selection of a box. Here is an illustration of my problem. The white box is where it is in my opengl screen, yet the yellow outline is where my hit is registered.
selection of box (http://people.clemson.edu/~rlieber/selection.jpg)
Here is the code that I use to make the selection. Thank you anyone for your help
code for selection (http://people.clemson.edu/~rlieber/cbtest.cpp)
I think your problem is in this lines:
it sould be:
5.0f, //here you can try a grater value - it's the size of picking region in screen cords(pixels?)
5.0f, //here you can try a grater value also
keep the same values used in your SizeOpenGLScreen function.
I think that OGL will report a hit when the mouse
is over the white rectangle, but not necessary when the mouse is in the CENTER of the rectangle.
Also you can play with gluPickMatrix's 3rd and 4th parameters. By increaseing them the rectangle will be picked when the mouse is close to the rectangle, but does not touch it.
05-15-2004, 11:36 AM
thank you, I put those values in for a reason for another program and just copied it into this one without really looking. Thanks again
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.