Accumulating rotations


I’m trying to implement an arcball.
I’m using glRotate() and i would like to accumulate the rotation in order for the object to start rotating from the last position and not reset to it’s origin position.

i’ve tried using glGet(MODELVIEW,matrix) after calling glRotate() and using multMatrix(matrix) before and it doesn’t seems to work…

thanks in advance…

Let’s see some code.

I understand what you’re saying, but there’s something missing here as that “just works”.

There’s quite a nice little web page about this actually :

I found it one day looking for something else.

One thing I would say is that for anything that free rotates then putting together a nice Matrix and Quaternion class I found makes things a lot smoother. There are plenty of nice examples out there you can Google for. Quaternions are not required to do this, but the way that you can rotate trivially without getting Gimbal lock when using Quaternions is very helpful.

And the best thing is you don’t have to actually understand Quaternions if you don’t wish to. :slight_smile: