public override void Loaded() { matrix = new DXFMatrix(); matrix = DXFMatrix.MatXMat(matrix, DXFMatrix.StdMat(new SFPoint(1, 1, 1), Point1)); }
public static DXFMatrix StdMat(SFPoint S, SFPoint P) { DXFMatrix Result = new DXFMatrix(); Result.data[0, 0] = S.X; Result.data[1, 1] = S.Y; Result.data[2, 2] = S.Z; DXFMatrix.MatOffset(Result, P); return Result; }
private static void MatOffset(DXFMatrix M, SFPoint P) { M.data[3, 0] = P.X; M.data[3, 1] = P.Y; M.data[3, 2] = P.Z; }
public static DXFMatrix MatXMat(DXFMatrix A, DXFMatrix B) { int I, J; DXFMatrix Result = new DXFMatrix(); for (I = 0; I < 4; I++) { for (J = 0; J < 3; J++) Result.data[I, J] = A.data[I, 0] * B.data[0, J] + A.data[I, 1] * B.data[1, J] + A.data[I, 2] * B.data[2, J]; } for (J = 0; J < 3; J++) Result.data[3, J] = Result.data[3, J] + B.data[3, J]; return Result; }