Jan
11-27-2005, 01:20 PM
Ok, i admit, i just don't get it.
Here is what i'd like to achieve:
I have a skeleton for skeletal animation. Every Bone stores a local rotation-quaternion and a local translation-vector.
Now, every frame i set those local transformations depending on an interpolated animation.
The next step is, to calculate the ABSOLUTE rotations (quaternion) and translations (vector) for every bone, so that i can send them to the GPU.
Note: I don't want to use matrices! With matrices everything works fine, but i want to do this using quaternions.
Now, i know how to rotate around a given point, using quaternions. That means, i have no problem rotating ONE object around it's center, or so. The problem arises, when using a hierachy of objects.
That means, if Object O2 is the child of O1, i want to include all rotations/translations of O1 into those of O2 and additionally rotate/translate O2 by its own local transformations.
And this is, where i am pulling my hair out the last 3 days.
Could someone maybe post some code or stuff to show me how this is done correctly? Please? Google seems to know no articles which explain this particular problem with quaternions.
My problem is not the rotation itself. That's easy, simply multiply the quaternion of O1 with that of O2 and it's rotated correctly. The problem is the pivot-point of O2. I want it to rotate around O1s pivot-point for O1s rotation and around O2s pivot-point for O2s rotation. You certainly know, what i mean. The problem is, i need to include this in O2s final translation-vector and there seems to be an infinite amount of wrong combinations possible, and i might be the first man on earth trying all of them :wallbash:
Thanks,
Jan.
Here is what i'd like to achieve:
I have a skeleton for skeletal animation. Every Bone stores a local rotation-quaternion and a local translation-vector.
Now, every frame i set those local transformations depending on an interpolated animation.
The next step is, to calculate the ABSOLUTE rotations (quaternion) and translations (vector) for every bone, so that i can send them to the GPU.
Note: I don't want to use matrices! With matrices everything works fine, but i want to do this using quaternions.
Now, i know how to rotate around a given point, using quaternions. That means, i have no problem rotating ONE object around it's center, or so. The problem arises, when using a hierachy of objects.
That means, if Object O2 is the child of O1, i want to include all rotations/translations of O1 into those of O2 and additionally rotate/translate O2 by its own local transformations.
And this is, where i am pulling my hair out the last 3 days.
Could someone maybe post some code or stuff to show me how this is done correctly? Please? Google seems to know no articles which explain this particular problem with quaternions.
My problem is not the rotation itself. That's easy, simply multiply the quaternion of O1 with that of O2 and it's rotated correctly. The problem is the pivot-point of O2. I want it to rotate around O1s pivot-point for O1s rotation and around O2s pivot-point for O2s rotation. You certainly know, what i mean. The problem is, i need to include this in O2s final translation-vector and there seems to be an infinite amount of wrong combinations possible, and i might be the first man on earth trying all of them :wallbash:
Thanks,
Jan.