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

Re: [pygame] Tiling a Rotated Bitmap



On Wed, Apr 2, 2008 at 3:49 PM, Kamilche <kamilche@xxxxxxxxxxxx> wrote:
> Brian Fisher wrote:
>  The resulting tile can be any shape, I don't care. I may have coded it up
> wrong, but it appeared Pete's code resulted in something that didn't tile.
>
Pete's code wasn't complete, but after fixes for rotation problems it
demonstrated doing rotated grid tiling (i.e. it tiled inside rotsurf).
Code that uses a similar approach could draw all the rotated image
copies it needed to fill whatever you needed to fill.

... of course it will still either have edge seams (if using rotozoom
for rotation) or nearest neighbor artifacts (if using rotate)

>  Do you spot a mistake in the app I posted?
>
Well in particular it was still trying to do rectangular tiling, as seen below:
-----------------------
def Tile(surf, pic, rect):
   x = rect[0]
   y = rect[1]
   while y < rect[3]:
       x = 0
       while x < rect[2]:
           surf.blit(pic, [x, y])
           x += pic.get_width()
       y += pic.get_height()
------------
you would never see code like that for rotated grid tiling.