2D sprite rotations help?
Posted: Sun Apr 28, 2013 4:43 pm
I have looked through a couple of the libraries (grrlib and libsprite) to see how they apply rotations however I must not be understanding of what they are doing.
This code below is the closest to what I want however it is rotating on what I can only assume is 0, 0. I am trying to rotate it from the center of the quad.
I then tried to use the rotation code from lesson4.c in the nehe examples and then the quad doesn't even show on the screen.
Any help would be appreciated.
This code below is the closest to what I want however it is rotating on what I can only assume is 0, 0. I am trying to rotate it from the center of the quad.
Code: Select all
guMtxIdentity(model);
guMtxRotDeg(tmp, 'z', angle);
guMtxTransApply(model, model, x + (w/2), y + (h/2), 0.0f);
guMtxConcat(model, tmp, model);
GX_LoadPosMtxImm(model, GX_PNMTX0);
Any help would be appreciated.