   pick vertex on model with mouse under perspective projection
  I wanner pick vertex on model with mouse, so i'm using gluUnproject to map 2D window coordinates to 3D object coordinates. The picking works well under orthogonal projection mode(glOrtho). But when i choose perspective mode(by gluPerspective), i can not pick vertex correctly. Truth is the object coordinates are not linear with the window coordinates.so, can i pick vertex under perspective projection mode? How to do that?any helps will be appreciated!   
  theres no differnce between glOrtho and gluPerspective (which calls glFrustum)so it should work recheck your code for differences   ;  If you're doing the picking correctly, it shouldn't matter whether the projection is orthographic or perspective. You might post the code where you construct the pick ray if you're not sure what the problem is.   ;  But anyways, what you're going to need to do is translate your object(s) by the modelviewprojection matrix, and then you can just compare x and y coordinates between where the mouse clicks in the window, and where each coordinate is (note that usually with perspective projection, y+ is in the up direction, where as window coords are specified with y+ going down)cheers (hope that helps)-Dan   ;  I suppose the way i just proposed is (way) pricey as, rather than translating one vertex, you're translating as many as there are vertices in your world/model.  But anyways, You are creating a line segment with the camera as the beggining, and the point (extended out a ways (scalar multiplication)(center + (point - center) * alot)) as the end. and do closest point to segment calcs.cheers hope THAT one helps-Dan   ;  Try increasing zNear and moving closer to the object. If that fixes it then your tolerance is too tight. Your unprojection just isn't that accurate. Since the unprojection isn't 100% accurate you have to find the vertex in some volume around the unprojected point. With orthographic a fixed volume works fine. With perspective that fixed volume may be less than a pixel if you get far enough away. You can click on this pixel or that pixel, but you can't click half way between two pixels so you end up with no way to select because you can't click close enough. So the further you get away from the camera the larger the select volume needs to be. How much larger? One way to decide is use the unprojection. Rather than just unproject (x,y,z) you unproject (x+/-1,y+/-1,d+/-1), i.e. eight points. You can then find the max/min x, y and z to define an axis aligned box. You then search for the vertex in that box.   ;  Well, HOW are you doing it? Just to be sure you don't just call unproject and use the result as some kind of final coordinate. If you don't have any kind of ray/object intersection test then something sounds wrong.Quote:How much larger? One way to decide is use the unprojection. Rather than just unproject (x,y,z) you unproject (x+/-1,y+/-1,d+/-1), i.e. eight points. You can then find the max/min x, y and z to define an axis aligned box. You then search for the vertex in that box.Wouldn't it make more sense to use a frustum instead of a box in that case? Or even just comparing some ray/point distance to threshold*z? Though the quickest way to get this distance from the top of my head would involve a vector subtraction, a cross and a dot product.   