November 29th: Deceptive

Well, I thought that figuring out what I wanted to do with the animation system would be the hard part and the actual programming would be trivial. I was mostly right, but it turns out there’s one problem that’s surprisingly sticky: Drawing the cached data in the right location. To do this I need to find where the upper left corner of the bitmap data lines up after its rotation, based on whichever point it rotates around.

I found a solution I was sure would work — rotating the four corners of the bitmap’s starting position with offset around the origin and finding the lowest x and y among them — but for some reason that creates a sort of flower pattern, where it lines up when the square is flat along one of the sides but bows out too far when it’s angled into a diamond shape. I can’t figure out why that is, so I’m gonna sleep on it.


About problemmachine

What is the nature of your problem? Can we modify the nature of your problem? Can your problem be touched? Eaten? May we eat your problem for you? May we eat your soul for you? Would you like a replacement problem? We make problems. We eat souls. We crap solutions. We are Problem Machine.
This entry was posted in Daily Update, Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s