gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Sprite dissapears

#14515 - alek - Wed Jan 07, 2004 9:47 pm

Hi
I'm working on my first gba project and I'm having difficulties getting sprites to rotate in mode 0. The sprite is displayed perfectly untill I set the rotation flag in attribute 0

Code:

#define ROTATION_FLAG       0x100
.
.
.
.
sprites[0].attribute0 = y | COLOR_256 | ROTATION_FLAG;


the sprite just dissapears and I'm left with a white box where the sprite should be. I just can't figure out what's wrong. Isn't it possible to rotate sprites in mode0 or have I just messed up some where else in the code?

#14516 - jma - Wed Jan 07, 2004 9:50 pm

The rotation matrix is wrong.

Jeff
_________________
massung@gmail.com
http://www.retrobyte.org

#14517 - alek - Wed Jan 07, 2004 10:02 pm

Yes, you were right. I looked it up in my old linear algebra book and it works perfectly now. Made a little misstake with the -SIN[angle] expression in the rotation matrix. Thanks for the quick response