interpolation entre 2 matrice avec DXDXQUATERNION

Started by
9 comments, last by DrGUI 19 years, 3 months ago
Salut, j'ai besoin dans mon programme de calculer les positions intermédiaire d'un objet, entre deux position données. Pour les translations c'est assez simple, le probleme se pose pour les rotations. Voila ce que je pensais faire: transformer la matrice de rotation en un quaternion via la fonction D3DXQuaternionRotationMatrix() modifier l'angle pour obtenir la bonne position et transformer le quaternion en matrice via D3DXMatrixRotationQuaternion() Mais s'était en supposant qu'un quaternion contenait l'axe de rotation dans x, y, et z et l'angle dans w, mais au vu du résultat je pense que ca ne doit pas etre ca. Quelqu'un peut-il m'éclairer? Merci!
Advertisement
Je ne comprends pas, pouvez-vous répéter la question en anglais? Merci.
There are precisely 10 kinds of people in this world - those that understand binary and those that do not.
It's OK I found...
incredible..
huraay!
*cough* No hablo espanol. *cough*

Any chance you could write it in English? You'll get much more help that way [lol]
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
Ok, ok. So, just for fun, here's an attempt at translation. It's been a while since I've read/written french, so french-speakers, pardon me if I suck [grin]:

Hello. In my program, I need to calculate the intermediate positions of an object, between 2 given poses. For translations, that's pretty simple, the problem comes from rotations. Here's what I want to do: Convert the rotation matrix into a quaternion using D3DXQuaternionRotationMatrix(), modifying the angle for obtaining the bone position, then converting the quaternion into a matrix using D3DXMatrixRotationQuaternion().

But a quaternion's supposed to contain the axis of rotation in its x,y and z components, and the angle in its w component. However, judging by the results I've got, it's not so.

Can someone please explain?
Thanks

French rulez!

Oui, Vous devez transfomer les rotations en quaternions et employer Spherical Linear intERPolation (SLERP) pour obtenir un quaternion entre les deux rotations. Puis vous transformez le resultat en matrice et voilà.
Mon français n'est pas aussi bon qu'il etait longtemps, j'ai oublié la plupart.
Does Egiptians speak in french?
Who said spanish? Spanish es re-groso loco.
Quote:Original post by Coder...
But a quaternion's supposed to contain the axis of rotation in its x,y and z components, and the angle in its w component. However, judging by the results I've got, it's not so.

Can someone please explain?
Thanks

I believe that you need to use a lot of trigonometry in calculating axis-angle quaternions.

Null probablement:
Je crois que vous avez besoin d'utiliser beaucoup de trigonométrie pour calculer de quaternions d'axe-angle.
Sorry my French isn't perfect...
IIRC The quaternion's not (x, y, z) of the axis, and the angle in w.
It's:
x: a * cos(t)
y: b * cos(t)
z: c * cos(t)
w: sin(t);
where (a, b, c) is the axis, and t is the angle

Desole, je parles pas francais parfaitement...
Si je me souviens correctement, le quaternion n'est pas (x, y, z) de l'axe, et l'angle dans w.
C'est:
x: a * cos(t)
y: b * cos(t)
z: c * cos(t)
w: sin(t);
ou (a, b, c) est l'axe, et t est l'angle.
Gah! That sure looked like spanish to me [wink]. I never have been good at foreign language...unless you consider C++ as a language [grin]
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )

This topic is closed to new replies.

Advertisement