I’ve written an application where i find the closest vertex to the mouse pointer on the 3d model. I currently use glOrtho and everything works perfectly. When i switch to using perspective view and gluLookAt the vertex selection doesnt work.
Is there a difference between the way the matices should be handled when using perspective vs ortho?
I solved my problem. It was a silly mistake, instead of unprojecting to the near and far plane of the frustum i unprojected to z = 0 , z = 1. Which works fine in glOrtho.
Hi
Even i experience the same problem.
I thought the problem was with the z-value passed to the gluunproject.
Can you tell me what is to be done after getting both the vertices in near plane and far plane.
I mean we need just one unprojected vertex right? Are we supposed to find a mean between the vertices of near and far plane ?