When I use gluUnproject I have to use three matrixes, ModelMatrix, ProjMatrix and viewport. Theese matrixes are the matrixes I change with glTranslate() and glRotate()???
Am I right?? and in that case, how can I use them as variables in gluUnproject()?? Anybody have an example on gluUnproject??
You have to provide the memory for the matrix to be copied to. For example, change GLdouble* modelviewMatrix = 0; to GLdouble modelviewMatrix[16]; and similarly for the other matrix, and viewport.