1

I have this idea in my head and I am trying to figure out how to implement it. One of the parts that I am struggling with is how to take a 3D rigid-body transform and decompose it into dx, dy, dz, theta_X, theta_Y, and theta_Z.

This of course is a very well document algorithm. My problem is that matrix algebra is noncommutative. I would like to reorder the components such that it goes (dx*dy*theta_Z)*(dz*theta_X*theta_Y).

For any of you who wants to know why I want to do this is because I would like to do apply the transform (dx*dy*theta_Z) on a 3D image followed by then another operation followed by the completion of the rigid body transform. Does anyone know how to do this?

comingstorm
  • 25,557
  • 3
  • 43
  • 67

2 Answers2

0

If I get it right you want to isolate XY plane transform separately from a 3D transform that is possible only if the theta_Z rotation is applied first (as you want it to be first). If not then you would need to convert your order of Euler angles first for example with this:

If you do not know the translations you can obtain them directly from matrix see:

now its just a matter of using the translations in corect coordinate system (depends on order of your transformations)

As you did not provide any specific data nor MCVE I can not go in more details as there are quite a few combinations of possible solutions.

Spektre
  • 49,595
  • 11
  • 110
  • 380
0

If you first decompose your rotation into your desired ordering (theta_Z * theta_X * theta_Y), it is reasonably straightforward to reorder any translation the way you want:

let:   t' = theta_Z^-1 * t * theta_Z

then:  t * theta_Z = theta_Z * t' 

and:   t * theta_Z * theta_X * theta_Y
     = theta_Z * t' * theta_X * theta_Y

However, for the particular reordering you want, please note that rotation about the Z axis should not affect a pure translation about the Z axis at all! Even though general rigid body transforms don't commute, your dz and theta_Z transforms do:

commutative:  dz * theta_Z = theta_Z * dz

and:  my_transform = dx * dy * dz * theta_Z * theta_X * theta_Y
                   = dx * dy * theta_Z * dz * theta_X * theta_Y
comingstorm
  • 25,557
  • 3
  • 43
  • 67