sceGumRotate in 2D

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
fish
Posts: 25
Joined: Wed Feb 08, 2006 5:12 am

sceGumRotate in 2D

Post by fish »

Hey all.

I'm trying to rotate a sprite/poly, in 2d (ie. most of the setup is the same as in the graphics.c in the scriptscribbler tutorials)

I figured it would be a simple case of:

Code: Select all

sceGumMatrixMode(GU_MODEL);
sceGumPushMatrix();
sceGumRotateZ(3.14159 * 0.25f); //45°

vertices = (Vertex*) sceGuGetMemory(4 * sizeof(Vertex));

//fill vertices

sceGuDrawArray(GU_TRIANGLE_FAN, Vertexinfo, 4, 0, vertices);

sceGumPopMatrix();
but this doesn't seem to do anything at all, the sprite/poly is still drawn unrotated, I've tried rotating X/Y/Z in case I was being stupid about which to rotate around, rotating before/after starting the GU.
I could of course manually calculate the roated vertices using sin/cos, but that's a waste of time when there's hardware that can/should do that a bajillion times faster anyway.

am I missing something really obvious? Is there maybe a toggle to tell the PSP that I want to use transformations? or is it something deeper?

thanks for any help
Post Reply