On Fri, Apr 12, 2013 at 3:54 AM, nick ralabate <
rala...@gmail.com> wrote:
>
> Just a quick follow-up: thanks! And I sort of stumbled over the
> documentation -- what is anti-diagonal? I sort of see what you mean
> in that the axis are flipped, but does it have anything to do with an
> anti-diagonal matrix (main hit on google)... e.g. is a 90 degree
> rotation the same as multiplying by an anti-diagonal matrix?
Actually it has little to do with an anti-diagonal matrix. It's an
anti-diagonal flip because the flipping happens in that direction (so
top-right and bottom-left corners are swapped) as opposed to
horizontal or vertical flipping.
You can use a matrix to do the anti-diagonal flip, using shearing to
swap the x and y axis. This is how Tiled does it, in fact:
https://github.com/bjorn/tiled/blob/master/src/libtiled/maprenderer.cpp#L111
In effect, an anti-diagonal flip is equivalent to either of the following:
Rotate 90 clockwise + Horizontal flip
Rotate 90 counter-clockwise + Vertical flip
Regards,
Bjørn