So the way I render images onto the screen involves having an array of color data from a buffered image. I can manipulate that one image, through the color data, and basically render any other image into that main buffered image. The problem I’m having right now is I’m having trouble implementing a rotation transformation correctly on this array.
I’ve gotten strange results, where the sprite is rotating around the origin (top left corner). I couldn’t really figure out how to make it rotate around it’s center or any point. Also with that rotation, there are tiny gaps in the sprite while it’s rotating.
This is how the rotation work - you need to use coordinates like (-1, 1).
About tiny gaps in the sprite - can you show this problem or explain it more?
When the object is rotating, the pixels themselves aren’t rotating around their center, they’re just rotating around another fixed point. So with that effect, there are pixel sized gaps evenly spread throughout the object. I think this happens in order to preserve the actual shape of the object.
So I guess there are a lack of linear algebra folk around here haha Close the thread, I’ve figured it out after reading a bit about matrix transformations.