(2023-04-04, 22:26)Jonathan N Wrote: You also create matrices with what looks like a single vector filled in (tmp) and then extract the vector from the multiplied result.
It's also not clear from the code how you accumulate the matrices. I would just keep a function parameter for the current accumulated transform. Each line type 1 would be a recursive call that passes the current transform multiplied by that line's transform to the function. When you see a vertex, multiply it by the current transform parameter.
It's possible to use a method that modifies the matrix field or property like what you have, but it's easy to forget to "reset" the transform when leaving a subfile. It helps to draw a tree on paper or work with a simple file with only a few pieces. A parent file's transforms affect its children, but the child transforms should not affect other files at the same depth in the tree. The function recursion will handle the case where a file has multiple subfile references.
I don't have any single-vector matrices. Each matrix I have is info of some type 1 line.
All the tmp stuff, just checked, is some old unused code I accidentally left in (thought I removed it) — the function actually in use is ParseLine1, not ReplaceLine1
For accumulating transformation — each time I encounter a type 1 line, I tranform it using matrix from current function call, and then pass that transformed line as an argument to call of the function right after, thus transformation is, or at least meant to recursively accumulate — and then each time it gives to the parent call transformed data
What is really a problem, as I mentioned in first post, is that for whatever reason line type 1s are not being properly transformed properly, while 2 through 5 work fine.
Maybe there really is something wrong with just using matrix multiplication, but that simply makes no sense to me — Vector3's transformation function should be doing exactly the same — matrix multiplication