[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Tiling a Rotated Bitmap



Brian Fisher wrote:

but if you want to make a rectangular tile that tiles on a rectangular
grid from your rotated image, then that is more complicated (unless
the rotation is 45 and the original image square - which is what Aaron
was talking about), but I would guess it can be done, but may result
in a disgustingly large tile (you'd have to keep tiling the image on
the rotated grid until the edge lines line up and cut a rect at that
point)

Yes, if you place down 9 square tiles in a 3x3 pattern, rotate the image plus or minus 45 degrees, then you can grab a new repeating tile by sampling any square inside the rotated image (any square that contains rotated data - naturally the corners don't count) that's approximately 1.414 (square root of 2) times the size of the original tile.

Other angles will repeat, too, but like Brian says, they'll be disgustingly large. As in many, many times the size of the original tile.

Aaron