RE: Need some help with code
2023-04-04, 21:30 (This post was last modified: 2023-04-04, 21:37 by Max Murtazin.)
2023-04-04, 21:30 (This post was last modified: 2023-04-04, 21:37 by Max Murtazin.)
(2023-04-04, 21:02)Jonathan N Wrote: The code will be more efficient and easier to understand if you represent points as a Vector3 and use something like Vector3.Transform instead of making everything a matrix. Linear algebra libraries have different conventions for whether matrices are row-major or column-major, which also influences the order of multiplication. I would recommend decomposing your accumulated matrices to make sure the translation, rotation, and scale matches what you would expect. It's easy to transpose or flip the order somewhere by mistake.
I do use both Vector3 and Matrix4x4 already