Is this a valid approach to decompose a transformation matrix with pivot points?


pir
05-26-2006, 03:05 AM
Hi!
I have looked around and couldn't find anything that helped me, its about how to decompose a transformation matrix when it contains pivot points. I hope this is the right place for this thread...



Background:
I'm implementing a 3d program having components organized in hiearchies. A child is inheriting the transformations from the parent.

Now I want to be able to break out a child from its parent and make it a orphin. But it needs to have the same transformation.

The transformation is represented in the components as translation, scaling and rotation. The rotation and scaling is transformed with a scaling pivot and a rotation pivot.

Since I've using openGL I can get the transformation matrix for the transformation of a child when it lies under its parent and I know it's pivot points and the start trans rot scale values.

My atempt:
So I have a transformation matrix which I want to separate in its tanslation rotation and scaling. It is not important which solution I get, just that I need to be able to do the scaling and rotation around the pivot points. And of course that the resulting transformation is the same as when the child had a parent.

I thought that I could use SVD for this, but then I got a bit uncertain when coming to the pivot points. So this is what I'm figuring to do:

SVD ( M ) -> S R // I suppose I can get a scaling and rotation matrix by this

M(last column)->T // the column representing the translation for the transformation matrix M

Here comes the part where I'm hoping will solve the pivot problem:
T - ( rotationPnumbers + scalingPnumbers ) -> the new translation

where rotationPnumbers and scalingPnumbers are the translation columns of the matrices representing the action of translate to pivot point and rotate/scale and translate back again.

the Question:
Is this valid?



thanks if you have read down to here
/pir