Ok I have tried to fix this numerous ways but I can’t seem to get it to work. Here is my ordeal:
I am working on a Silicon Graphics box and I am working on code that allows you to pan/zoom/rotate a 3d object. My zooming algorithm works just fine, but I have run into a problem with the pan/rotate.
Each of the three mouse buttons do different things. Left button is Pan, middle is zoom, and right is rotate. Currently I call glRotatef and then glTranslatef. My rotation works fine because the object rotates about its center.
The problem is that when I rotate the object 180 degrees horizontally or vertically then the panning is off 180 in the respective direction (i.e. panning down makes the object move up, left moves the object right).
I tried switching the order of the calls and making Translate first and then Rotate and that fixes the panning problem, but then the object rotates about the world origin which I dont want. It needs to rotate about its center.
Email me at firstname.lastname@example.org for clarification.