void myMouse(int button, int state, int x, int y) { y = screenHeight - y; switch (button) { case GLUT_LEFT_BUTTON: if (state == GLUT_DOWN) { if(pointSet) { specialRayCoord.set(specialRayCoord.left, specialRayCoord.top, x, y); specialRayCoord.fix(); doSpecRayTrace = 1; pointSet = 0; glutPostRedisplay(); } else { specialRayCoord.set(x, y, 0, 0); pointSet = 1; } } } }