Converting Matrices to translations and back changes geometry in Animation Nodes

2018-04-08 04:34:07

I was just working on an AN function to tilt a ring of points inwards or outwards from their center. The circle is generated from the Distribute matrix node, and then Z values are added from another source.

I got it working just fine in a test file, but when I added it into a large project, the points were just rotating around the Y axis.

Further investigation showed that the problem originated in the fact that I was converting the matrices into translations before returning them to the node that called the function, and then they were being converted back into a matrix in the next node group.

Clearly, the simple answer is to keep the values stored as matrices for as long as possible, and don't be converting back and forth. However, for my own curiosity I wondered if anyone could shed any light on why this is happening at all?