It’s handy to just write down what you’re doing when rotating about an arbitraty point P with a matrix.

First, we need to get P at the origin, so we translate with -P. Then we rotate with R, and then reapply the translation P. The matrix equation (when using row vectors as in D3D) therefore is MP-1 * MR * MP. As you need a transformation in the form rotation*translation, we need to reverse the order of MP-1 * MR, so we get MR * A = MP-1 * MR.

Calculating A is simple: as the final expression should read MP-1 * MR, and we start with MR * A, we can cancel out the first MR transformation by multiplying with MR-1, which yields the identity matrix, and then multiply with the original expression we are looking for: MP-1 * MR. Therefore, A = MR-1 * MP-1 * MR, which will always yield a simple translation matrix around the point -P * MR.

Fill that in the final equation, and the translation vector you’re looking for is (-P * MR) + P

Hi there

Ok, the situation is as follows: I have a mesh and want to animate it. Up to now i have used relative rotations and translations at every bone to construct a bone-matrix, which incorporates the whole transformation at a given bone.

Since current GPUs (Radeon 9700) are not able to store enough bone-matrices for my purposes, i want to switch from matrices (16 values per bone) to quaternions and a translation vector (4 values for the quaternion, 3 for the tanslation = 7 values).

Now i need to compute my final quaternion/translation stuff to send it to the GPU. However, when using matrices i had no problem to rotate around a certain point. I first translated that point to 0, then rotated, then translated it back. All that can, of course, be put into one final matrix.

But how do i do that with quaternions??? Certainly i need to modify my translation-vector for that bone, so that after the rotation by the quaternion, the vertex then gets translated to the point where it was supposed to be rotated around.

I just can’t figure out the maths, how to achieve this, at the moment.

Would be nice, if someone could enlighten me :lol:

Thanks,

Jan.