Given I have a 2D affine transform described by the matrix:
[ a c tx ]
[ b d ty ]
[ 0 0 1 ]
Such that:
[ x ] [ a c tx ] [ x ] [ a * x + c * y + tx ]
[ y ] = [ b d ty ] [ y ] = [ b * x + d * y + ty ]
[ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
I have a shape that starts at [-(width/2), -(height/2)] so that it is centred about [0, 0].
I want to change the origin of the shape so that it starts at [0,0] but I want its transformed coordinates to be the same.
How do I update the matrix to map the objects new origin to the same end position?
I seem to be failing at the point where when x or y equals = 0 everything just cancels out and becomes:
[ tx ]
[ ty ]
[ 1 ]