YourGamerMom -4 Newbie Poster

In my program you should be able to look around smoothly with the mouse, my code works, but I'm wondering if there is any better, smoother way of doing this.
My code to get the mouse position as if the center of the window was 0,0 (LookAround() is the passive motion callback):

void LookAround(int MGx, int MGy){
	if (pause != 1){
	Mx = MGx - (glutGet(GLUT_WINDOW_WIDTH)/2);
	My = MGy - (glutGet(GLUT_WINDOW_HEIGHT)/2);
	glutPostRedisplay();
	}
}

My code to implement this into the gluLookAt function.

gluLookAt(Ex, 0.0, Ez, Mx, My, 5.0, 0.0, 1.0, 0.0);

thanks in advance
(written in C).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.