Re: [pygame] Tiling a Rotated Bitmap
Well, basically, I want to take a picture, rotate it 15 degrees, and use some algorithm to jam all the pixels lying outside the bounding box back inside the box, and have the result be tilable. I thought it should be possible, but it's a thornier problem than I realized. --Kamilche
Re: [pygame] Tiling a Rotated Bitmap
On Tue, Apr 1, 2008 at 8:32 PM, Aaron Maupin <[EMAIL PROTECTED]> wrote: > That will only work if you rotate the bitmap 45 degrees. (Or some > multiple of 45 degrees ;) > You may be right about particular rotation implementations, but in general taking a tile and rotating it and expecting it tile is neither guaranteed to work at 45 degrees nor is it guaranteed to not work at other angles. It can still be wrong at 45 degrees if your rotation is antialiased. It can be right at odd angles if the edges pixels are not antialiased or resampled. It can be wrong if the algorithm for determining what pixels to draw is inconsistent. It can be right if the algorithm draws everywhere the rotated tile has > 50% pixel coverage. In OpenGL land that means you need either a GL_TEXTURE_WRAP_x of GL_CLAMP_TO_EDGE_EXT or to use GL_NEAREST filtering. In Pygame land it means you'll get seams with rotozoom, and rotate may work as long as it's algorithm is properly consistent (although it will be ugly nearest neighbor on the inside)
Re: [pygame] Tiling a Rotated Bitmap
Kamilche wrote: My first attempt was to tile the bitmap across a larger picture, rotate the larger picture, and then cut a tile out of the middle, but that didn't work - the resulting picture wasn't tilable. That will only work if you rotate the bitmap 45 degrees. (Or some multiple of 45 degrees ;) It's really awkward to work with other angles, because they don't match up well in a tiled system. Aaron
[pygame] Im thinking of making a pawngame.com version in python
I've never did anythng like this, but I admit the game is fun, but flash is F`n slow when theres hundreds of users online at once. I feel if you code on your desktop and distribute the code it shall work quicker. So does anyone have any tips, any thing I should know before going about this project I'm a bit rusty at pygame so I need as much feedback as possible :) -- Join cleanscript.com Come here for professional PHP coding.
Re: [pygame] Tiling a Rotated Bitmap
when you say the resulting picture is not tileable - what exactly do you mean? (screenshot?) do you mean that you see seams (dark or partially transparent lines through the joints between tiles) when you try to draw the tiles next to each other? If you do, it's probably an alpha problem (using rotozoom?) where the tile edges draw to partial pixels. if the not tileable problem is something else - then screenshots will probably help a lot in understanding the problem. On Tue, Apr 1, 2008 at 7:57 PM, Kamilche <[EMAIL PROTECTED]> wrote: > Hi all. I'm trying to create a rotated tilable bitmap out of a tilable > bitmap, but it's not working. My first attempt was to tile the bitmap > across a larger picture, rotate the larger picture, and then cut a tile > out of the middle, but that didn't work - the resulting picture wasn't > tilable. > > I see that the problem is a lot more complex than I thought, and I don't > have a handle on how to do it. > > Does anyone know how to perform such a task? > > --Kamilche >
[pygame] Tiling a Rotated Bitmap
Hi all. I'm trying to create a rotated tilable bitmap out of a tilable bitmap, but it's not working. My first attempt was to tile the bitmap across a larger picture, rotate the larger picture, and then cut a tile out of the middle, but that didn't work - the resulting picture wasn't tilable. I see that the problem is a lot more complex than I thought, and I don't have a handle on how to do it. Does anyone know how to perform such a task? --Kamilche
[pygame] mixer.music in runtime
Hi I am trying to run pygame.mixer.music after having created a py2exe. The import seem to work ok, but it never loads the music method so the following doesn't work import pygame.mixer print pygame.mixer.music Traceback (most recent call last): File "test.pyw", line 728, in File "test.pyw", line 128, in main File "vers_01\Program\Test\testgame.pyw", line 66, in run File "vers_01\Program\Test\testgame.pyw", line 147, in __init__ File "vers_01\Program\Test\testgame.pyw", line 158, in initiate_music File "vers_01\Program\TestMusic\__init__.py", line 1, in File "vers_01\Program\TestMusic\musix.pyw", line 11, in AttributeError: 'module' object has no attribute 'music' In the developer version it works and the print returns : Files\Python2_5\Lib\site-packages\pygame\mixer_music.pyd'> What could I be doing wrong ?