void mous(int button, int state, int x, int y) // when mouse first clicked: set initial values // of holder variables { xo=x; yo=y; } void mouser( int x, int y) // when mouse moved, change actual rotation variables // and reset the holder variables { xrot+=x-xo; yrot+=yo-y; xo=x; yo=y; }These functions took me a while to get exactly how I wanted them, and the took a few more global variables than I expected. The initial values of the mouse position are set when the mouse is first clicked to x0 and y0. Then, as the mouse moves, the rot variables, which is what determines the rotation of the display, are reset with every tiny change. Of course, since the picture is redrawn with every small change, the x0 and y0 values are also reset. This allows for constant and smooth changes in the picture rotation. Generally, by clicking and dragging the mouse, the image will rotate around so it can be viewed from all angles.