mshadows
03-16-2010, 06:59 PM
Hi guys,
I couldn't find anything whilst searching the forums and I'm at a loss to explain what's happening myself so I thought I would post to see if anyone can help me out, thanks in advance.
I've been designing a game engine based on one I found online (here (http://www.brighthub.com/internet/web-development/articles/11010.aspx)). This engine uses double buffering and copypixels to draw bitmapData to the screen, and it also has frame based animations going on too. I wanted to extend this to allow for rotating these animations.
I wanted to rotate the bitmapData in question (a character on screen for example) and then copyPixels it to the screen. I ran into a lot of trouble with this. After a lot of research and experimentation, what I eventually ended up doing was a lot of prerendering on each frame in my animation, so that I had a copy of it at all angles (well at intervals of 5 degrees). Then what I would do is blit in the correct frame of the animation and rotation onto the screen.
This is great and works a treat... Almost. When the image is not at a 90 degree angle it will kind of flicker. I have no idea why this is, i can only think that the matrix transformation i perform on the image when rotating it produces different results on the same image, but that doesn't make sense to me. Can anyone shed any light?
I have attached my SWF and also the corresponding frame based animation, this should make my problem clear.
Mshadows
I couldn't find anything whilst searching the forums and I'm at a loss to explain what's happening myself so I thought I would post to see if anyone can help me out, thanks in advance.
I've been designing a game engine based on one I found online (here (http://www.brighthub.com/internet/web-development/articles/11010.aspx)). This engine uses double buffering and copypixels to draw bitmapData to the screen, and it also has frame based animations going on too. I wanted to extend this to allow for rotating these animations.
I wanted to rotate the bitmapData in question (a character on screen for example) and then copyPixels it to the screen. I ran into a lot of trouble with this. After a lot of research and experimentation, what I eventually ended up doing was a lot of prerendering on each frame in my animation, so that I had a copy of it at all angles (well at intervals of 5 degrees). Then what I would do is blit in the correct frame of the animation and rotation onto the screen.
This is great and works a treat... Almost. When the image is not at a 90 degree angle it will kind of flicker. I have no idea why this is, i can only think that the matrix transformation i perform on the image when rotating it produces different results on the same image, but that doesn't make sense to me. Can anyone shed any light?
I have attached my SWF and also the corresponding frame based animation, this should make my problem clear.
Mshadows