Rotation of objectwith Mouse


can any body out there help me in rotating
a 3D object in space using mouse?
please reply.

u can rotate in two ways move the camera or move the object apply modelview Matrix transformations
in both the cases.

What I do is keep four variables: oldMouseX, oldMouseY, currMouseX, currMouseY.
Depending on the amount by which the mouse coordinates change upon dragging, I make call glRotate with a varying angle and then update the current mouse coordinates to the old mouse coordinates.

There might be easier/faster ways to accomplish it, but this is the only one I happen to know.