gluUnproject + gluLookat

Started by
0 comments, last by BytePtr 12 years, 7 months ago
Hi
Im picking cubes using gluUnproject. Cubes are textured.
When i look at one cube from right upper corner and click for example on right side of cube. The XYZ coordinates are correct.
If i click on BOTTOM side of cube the Y is increased by one:

Look the pic, the bomb texture should be always on top of the cube, no matter which angle camera (gluLookAt) has and no matter what side of cube user clicked.

http://img836.imageshack.us/img836/4720/badcoord.jpg

If i rotate camera, then sometimes correct coord is returned and cube top is textured

http://img694.imageshack.us/img694/3451/goodcoord.jpg


This bug ruins all my work i have done for OpenGL selection buffer and i really would like to know what the hell causes such bug?
I even disabled texturing on that cube and still picking sometimes adds the +1 to coordinates.

Basically TOP side where the bomb texture must be the picking seems to return always correct coord, but all cube sides cause some problems.
And the coords for some reason sometimes depend on camera angle.

+1 is added to sometimes to coords (not more than 1) when clicking on cube sides.
But it shouldn't, it just must register the fact that cube is clicked, no matter where gluLookAt is looking.


Any ideas what can cause that problem?

Im will be very thankful if somebody could point me to right direction with that.

Thank you.
Advertisement
No one really knows what causes this inaccurate gluUnproject behaviour?
This bug is driving me nut's.

Im doing something wrong but i don't know what.
I don't think that this is normal.

This topic is closed to new replies.

Advertisement