i have a little problem.
I have interval. 250 means 0 and 500 means 2. How i can get number between 0-2 by changing coordinates from 250 to 250.
void MouseButton(int button, int state, int x, int y)
{
// MIN(250) - 0
// MAX(500) - 2
if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
{
pos2[0] = ( (float)x * 2 ) / ((float)m_viewport[2] -1);
printf("%f - %d\n", pos2[0], x);
}
}