I'm making a simple 2d game that has a grid based building system. I have several "parts" (square, triangle, etc...) And for everything to look pretty the pixels have to line up correctly. For some reason the system I am using to rotate sprites is causing some of the sprites to rotate off of their center, so the pixel no longer line up (so if a square is at rotation 0, rotating it to 90 shouldn't cause a shift in the square's center). I'm using this system by Lonesome Ducky. I've also provided a link to my drawing source in case there is any questions on the drawing system, I've been working on it for a while and I can't seem to fix it, at first I thought my centers were off but I've triple checked everything and it is right.
Drawing Source
Header
CPP
Thanks!
G0bl1n
Problems with 2D Image Rotation (Interpolation?) [SOLVED]
Problems with 2D Image Rotation (Interpolation?) [SOLVED]
Last edited by g0bl1n on Sun Jun 26, 2011 6:04 am, edited 1 time in total.
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Hey I figured it out! Turns out my origin was at (5.5,5.5) on my 11x11 image, but I was using a u32 to store the origin, so it was only storing (5,5), switched to f32 and all works fine now! Funny thing is that I didn't even look at that part of the code until you mentioned the origin stuff!
Thanks!
Goblin
Thanks!
Goblin