Sign in to follow this  

interpolation entre 2 matrice avec DXDXQUATERNION

This topic is 4727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
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]

Definately French [wink].
As a programmer, I can say that I actually prefer the syntax of French to English [grin] - most adjectives seems to agree to the noun where sometimes in English, an adjective that looks plural is actually singular and vv.
That said, English is my 1st language and my target grade is A or A*. I am also very good at French reading and writing, but unfortunately rubbish at speaking and listening. Programming has probably helped me in French!

Share this post


Link to post
Share on other sites

This topic is 4727 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this