// Given local coordinate return project coordinate
CPoint3D COGLView::CoordinateUnProject(CPoint3D *point)
{
CPoint3D result;
GLdouble modelMatrix[16];
GLdouble projMatrix[16];
GLint viewport[4];
GLdouble objx, objy, objz;
glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix);
glGetDoublev(GL_PROJECTION_MATRIX, projMatrix);
glGetIntegerv(GL_VIEWPORT, viewport);
gluUnProject(point->x, point->y, point->z, modelMatrix, projMatrix, viewport, &objx, &objy, &objz);
result.x = (double)objx;
result.y = (double)objy;
result.z = (double)objz;
return result;
}