Jump to content
  • Advertisement
Sign in to follow this  

OpenGL gluUnproject + gluLookat

This topic is 2955 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.


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


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.

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!