Being new to OpenGL I quickly realized how much more difficult it is to rotate in 3D space than one would think. I checked out tons of tutorials and they suggested quaternions. So I did some research on them and the closest I came to was this:

When I run this code, I get a slightly better effect than using 3 separate glRotatef calls. Before, when I rotated the object about an axis over 180 degrees, the other axis would be reversed to the viewer since, to my understanding, the axes are relative to the object. With this code, rotating about the y-axis works the way I want it to regardless of the orientation: it rotates relative to the user. However, I still have a problem when the rotation on the y-axis is greater than 180: the x-axis rotates the opposite way that it intuitively should to the user.