varieux

06-03-2009, 05:12 AM

Hi folks,

I've been struggling with how to use quaternions for rotation.

I found a boiler-plate routine that converts [x,y,z,w]

to a rotation matrix.

I had thought that by altering the angle "w" linearly,

e.g. based on the position of the mouse pointer on

the display, I could cause a linear rotation to occur

about the axis [x y z], which I've preset to [0 1 0].

However this has proved to be. The rotation is not linear at all.

I set w to be proportional to the mouse's x value, and

then I normalize [x y z w].

What I observe unfortunately is that rotation slows down

toward 180 degrees in either direction.

Can anyone explain why this happens?

Thanks.

I've been struggling with how to use quaternions for rotation.

I found a boiler-plate routine that converts [x,y,z,w]

to a rotation matrix.

I had thought that by altering the angle "w" linearly,

e.g. based on the position of the mouse pointer on

the display, I could cause a linear rotation to occur

about the axis [x y z], which I've preset to [0 1 0].

However this has proved to be. The rotation is not linear at all.

I set w to be proportional to the mouse's x value, and

then I normalize [x y z w].

What I observe unfortunately is that rotation slows down

toward 180 degrees in either direction.

Can anyone explain why this happens?

Thanks.