I dug up some very old LD4DModeler code, which used DirectX

In it I do correction during the type 1 line loading.

rh2lhflip is inited elsewhere as D3DXMatrixScaling(rh2lhflip, 1, -1, 1);

Do note this is very (11 years!) old code, and I wasn't exactly an expert myself at that time

edit: above code is less then correct and unnecessary overcomplicated. It's better to convert to lefthand/neg y axis at the model level.

In it I do correction during the type 1 line loading.

Code:

`//x y z`

matrix.m[3, 0]:=getvalue(line);

matrix.m[3, 1]:=getvalue(line);

matrix.m[3, 2]:=getvalue(line);

matrix.m[3, 3]:=1;

//a b c

matrix.m[0, 0]:=getvalue(line);

matrix.m[1, 0]:=getvalue(line);

matrix.m[2, 0]:=getvalue(line);

//d e f

matrix.m[0, 1]:=getvalue(line);

matrix.m[1, 1]:=getvalue(line);

matrix.m[2, 1]:=getvalue(line);

//g h i

matrix.m[0, 2]:=getvalue(line);

matrix.m[1, 2]:=getvalue(line);

matrix.m[2, 2]:=getvalue(line);

matrix.m[0, 3]:=0;

matrix.m[1, 3]:=0;

matrix.m[2, 3]:=0;

//rechthandig matrix -> linkshandige matrix

//(T^-1)ST waar s bron is en T rh2lhflip is

//mat:=rh2lhflip^-1

D3DXMatrixInverse(mat, @dummy, rh2lhflip);

//mat:=(rh2lhflip^-1)*s

D3DXMatrixMultiply(mat, mat, matrix);

//s:=(rh2lhflip^-1)*s*rh2lhflip

D3DXMatrixMultiply(matrix, mat, rh2lhflip);

rh2lhflip is inited elsewhere as D3DXMatrixScaling(rh2lhflip, 1, -1, 1);

Do note this is very (11 years!) old code, and I wasn't exactly an expert myself at that time

edit: above code is less then correct and unnecessary overcomplicated. It's better to convert to lefthand/neg y axis at the model level.