OpenGL scene coordinates to screen coordinates
I'm having trouble converting my OpenGL scene coordiates to my screen coordinates. I thought I needed to multiply my coordinates with the modelview matrix then with the projection matrix to get the ndc. But i'm getting weird coordinates. Here is my piece of code GLKVector3 coor = GLKVector3Make(point.x, point.y, 0); GLKMatrix4 modelview = GLKMatrix4MakeWithArray(glProjectionMatrix); GLKMatrix4 projetion = GLKMatrix4MakeWithArray(modelViewMatrix.data); GLKVector3 eyeCoor = GLKMatrix4MultiplyVector3(modelview, coor); GLKVector3 ndcCoor = GLKMatrix4MultiplyVector3(projetion,eyeCoor); CGPoint p =