I first pick up the events that give me X and Y coordinates on mousedown on the screen and depending on the direction the mouse is moving (using mouse move event) set the relevant rotX, rotY to rotate by 2 in that direction. Then after in the draw function i set rotX Y and Z to 0 so it doesnt continue to rotate if the mouse button is left down.
As for rotZ uses the X coordinate but only when the middle mouse is down.
void __fastcall TmainForm::drawMesh()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glRotatef(rotX, 1, 0, 0);
glRotatef(rotY, 0, 1, 0);
glRotatef(rotZ, 0, 0, 1);
// after this i call the draw class which just draws the triangle
// mesh on the screen at this location
What i find strange is why its smooth on one of the axis and jittery on the other two.