commit d0f5c9de800774d83742b984e064e5802525c387
parent 31654a41ee1f27e993ba6a4b4ed063fbb2d2f1a7
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 19 Nov 2025 09:23:56 +0100
Fix the parsing of a translation transformation
The matrix representing the transformations to be applied was
incorrectly updated with regard to the translation parameters.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/mtool_args.c b/src/mtool_args.c
@@ -75,6 +75,7 @@ static res_T
apply_translation(struct mtool_args* args, const char* str)
{
double translation[3] = {0,0,0};
+ double tmp[3] = {0,0,0};
double vec[3] = {0,0,0};
size_t len = 0;
res_T res = RES_OK;
@@ -90,8 +91,8 @@ apply_translation(struct mtool_args* args, const char* str)
* | C F I L | | 0 0 1 Tz | | C F I (C*Tx + F*Ty + I*Tz + L) |
* | 0 0 0 1 | | 0 0 0 1 | | 0 0 0 1 | */
d3_muld(vec, args->transform+0, translation[0]);
- d3_add(vec, vec, d3_muld(vec, args->transform+3, translation[1]));
- d3_add(vec, vec, d3_muld(vec, args->transform+6, translation[2]));
+ d3_add(vec, vec, d3_muld(tmp, args->transform+3, translation[1]));
+ d3_add(vec, vec, d3_muld(tmp, args->transform+6, translation[2]));
d3_add(vec, vec, args->transform+9);
d3_set(args->transform+9, vec);