1
votes

I am working with Opengl es to create a stickman and this might seem like a stupid question but when using quaternions to represent rotation what should I do if want the rotation to be around another point than the origin and should I use a unit quaternion or not. my guess is I can rotate and then translate too change the centre of rotation and I'm not going to use unit quaternions. Is this the right path?

1
Why would you not use a unit quaternion? - Marcelo Cantos
well the unit quaternion would give me rotation on a unit 3 dimensional sphere. And I guessed this is not what I want since the point I want to rotate is on an arbitrary sphere - Steve
An arbitrary quaternion doesn't offer enough degrees of freedom to rotate around an arbitrary point (it only offers one extra degree, whereas the point requires three). You can't avoid applying an offset as well. - Marcelo Cantos
ok, so I need to use a unit quaternion and apply an offset to the centre of rotation so I can get a rotation about that center? - Steve

1 Answers

1
votes

Like said in the comments, a non-unit quaternion does not magically rotate around an arbitrary point. So there is no need to use non-unit quaternions. What you need to do is, translate your rotation center to the origin, rotate about the origin with the quaternion as usual and then translate back to the rotation center.

If you want to really represent this whole transformation in a single mathematically clean construct, you can use dual quaternions, but I'm sure this will be overkill.