User Information:

Cinema 4D Version: R13-R14

Platform: Windows ;

Language(s) : XPRESSO ;

---------

I am not sure how to do this.

For the position, is is easy:

```
Matrix matrix_A;
Matrix matrix_B;
matrix_B.off = matrix_A.off;
```

What is the corresponding way for the scaling?

]]>I will have a look at Normalize(), maybe it will do what I want. But in case the original scale is _<__>_ 1, I will need to use the first code you provided.

]]>You could simply get the normalized matrix. That is, it will only contain the rotations and turn any scaling into unity (1s).

```
Matrix resultMatrix = q_b.GetMatrix();
resultMatrix.Normalize();
```

]]>Ok, thanks, tat is indeed a lot, just to keep the scaling.

I often do some calculations on Quaternions, and the unwanted side effects is that scaling is influenced too, even if it is the rotation only, that I am interested in.

```
Quaternion q_A;
q_A.SetMatrix(inputMatrix);
Quaternion q_B = QMul(q_A, 1.5);
Matrix resultMatrix = q_B.GetMatrix();
```

I get the resulting rotation I am after, but I get the scale multiplied by 1.5 too.

So I have to write the code you submitted, OK. No simpler way..

In order to get the scales (vector) out of a matrix, you need to get the length of each axis basis:

```
Vector scale = Vector(Len(matrix_A.v1), Len(matrix_A.v2), Len(matrix_A.v3);
matrix_B.v1 = !matrix_B.v1 * scale.x;
matrix_B.v2 = !matrix_B.v2 * scale.y;
matrix_B.v3 = !matrix_B.v3 * scale.z;
```

This information is in the SDK documentation.

]]>