Criptych
Joined: 12 Sep 2009 Posts: 79
|
Posted: Tue May 11, 2010 7:32 am Post subject: [SOLVED] Textures don't show up with GU_TRANSFORM_3D |
|
|
Thanks anyway, but it was an even stupider mistake than that. Tip: don't use unsigned ints interchangeably with signed ints. *sigh*
Whenever I try to draw using sceGumDrawArray with GU_TRANSFORM_3D, none of my textures are displayed, yet when I switch to _2D they are (but can't use the model/view matrices), and it seems the coordinates are okay because I can get textureless and wireframe models to work. I've gotten this to work in the past, but I can't remember how. It's probably just an option I forgot to enable, but can someone please give me a clue? :(
Here's one of the relevant snippets:
| Code: | void Ship::Draw()
{
pgeTextureActivate(ship);
// *** This works fine, using GU_TRANSFORM_2D, but is not transformed properly.
//pgeGfxDrawTextureEasy(ship, x, y, angle, 255);
pgeVertTV *vert = (pgeVertTV*)pgeGfxGetVertexMemory(sizeof(pgeVertTV)*4);
vert[0].u = 0; vert[0].v = 0;
vert[1].u = 0; vert[1].v = ship->height;
vert[2].u = ship->width; vert[2].v = ship->height;
vert[3].u = ship->width; vert[3].v = 0;
vert[0].x = -(ship->width>>1); vert[0].y = -(ship->height>>1); vert[0].z = 1;
vert[1].x = -(ship->width>>1); vert[1].y = (ship->height>>1); vert[1].z = 1;
vert[2].x = (ship->width>>1); vert[2].y = (ship->height>>1); vert[2].z = -1;
vert[3].x = (ship->width>>1); vert[3].y = -(ship->height>>1); vert[3].z = -1;
// *** This doesn't show up at all!
sceGumMatrixMode(GU_MODEL);
sceGumPushMatrix();
ScePspFVector3 pos = { x, y, 0 };
sceGumTranslate(&pos);
sceGumRotateZ(angle);
sceGumDrawArray(
GU_TRIANGLE_FAN, PGE_VERT_TV | GU_TRANSFORM_2D, 4, NULL, vert);
sceGumPopMatrix();
}
|
_________________ PSP-2000 // CFW: 5.50 GEN-D2 ...and not upgrading until OFW supports homebrew!
(But I did downgrade to 1.50 with TimeMachine...)
"I want you to tell me how the machine makes you feel." |
|