matrix decomposition !!!!

I would like to extract from a given matrix the translation, the rotation, the scale, and the scale orientation:

Does somebody have source codes ? Please !!!

I use the source code of Ken Shoemake and Tom Duff. Matrix Animation and Polar Decomposition. Proceedings of Graphics Interface 1992. GEM IV http://www.acm.org/tog/GraphicsGems/ but it seems to not work properly with uniform scale like the following matrix:
[1 0 0 0]
[0 0 1 0]
[0 -2 0 0]
[0 0 0 1]
give

  • translation T = (0 0 0)
  • rotation R = ( (1,0,0) PI/2 )
  • scale S = (1 1 2) AND NOT (1 2 1) !!!
  • scaleOrient So = ( (0,0,1) 0 )
  • determinant sign Si = 1
    The recomposed matrix M = T* (Si*R) SoS is
    [1 0 0 0]
    [0 0 -1 0]
    [0 2 0 0]
    [0 0 0 1]

I need help !
Thanks a lot for all your contributions !
David.

Please Help !

Nobody wants to talk to me…

http://www.flipcode.com/documents/matrfaq.html

Thanks Zed

Sancho,

The recomposed matrix should be (according to the source code):

M = (T) (F) ® (U) (K) (U^T)

Where T is translation, F is the sign of the determinant, R is the rotation, U is the “scaling rotation”, and K is the scale.

It looks to me like perhaps you have some transpose going on that you don’t intend. Perhaps you’re indexing the array wrong?

Cass

[This message has been edited by cass (edited 06-07-2001).]

the matrix (of type HMatrix)to decompose should be in row/column or column/row ?

This question could appear stupid but it’s to be sure…

Thanks Cass.

Originally posted by cass:
[b]Sancho,

It looks to me like perhaps you have some transpose going on that you don’t intend. Perhaps you’re indexing the array wrong?

Cass

[This message has been edited by cass (edited 06-07-2001).][/b]

You are totaly right !!
Thanks again Cass.
Now, I feel like stupid…

David