Coordinate system

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

Moderators: cheriff, TyRaNiD

Post Reply
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

Coordinate system

Post by starman2049 »

Sorry for the newbie question, but I could find by searching. What is the coordinate system on PSP. Is it right-handed y-down like in PS2, or what?
User avatar
0x0001
Posts: 11
Joined: Thu Jul 21, 2005 10:02 am

Post by 0x0001 »

yes cordinates are x across y down
same as ps2

480 pixels for x
272 for y
RustyFunkNut
Posts: 17
Joined: Mon Sep 26, 2005 5:10 am
Location: London, UK

Post by RustyFunkNut »

It's also worth pointing out that ScePspMatrix4 is transposed with respect to a D3DMATRIX. Caught me out when converting some of my old code across :)
CyberBill
Posts: 86
Joined: Tue Jul 26, 2005 3:53 pm
Location: Redmond, WA

Post by CyberBill »

PSP Matrices are directly in line with OpenGL matrices, but yes, D3D matrices have their axis reversed.
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

Post by starman2049 »

Thanks for the info all. I am still playing around with getting my existing camera code working. After not making much progress I am trying to get a simplification working first.

If I set my View Matrix up as follows:

Code: Select all

sceGumMatrixMode(GU_VIEW);
sceGumLoadIdentity();
then I get what I expect, the camera at the origin, aligned with the z-axis, and I can see parts of my scene as I would expect.

If I set my View Matrix up as follows:

Code: Select all

ScePspFMatrix4 worldM;
matrix_identity( (float*)&worldM); // taken from lights.c sample code
sceGuSetMatrix(GU_VIEW, &worldM);
Then I am not able to see anything but black screen. I am not really sure why these would be different. Does anybody have any ideas? I am wondering if it could be single vs double precision float issues? or maybe sceGuSetMatrix() has a bug in implementation?

Any help is GREATLY appreciated!!
starman2049
Posts: 75
Joined: Mon Sep 19, 2005 5:41 am

Post by starman2049 »

Ok, so after taking a different approach I see that I can use:

Code: Select all

sceGumMatrixMode(GU_VIEW);
sceGumLoadMatrix(&worldM);
Which seems to work better. I don't know why

Code: Select all

sceGuSetMatrix(GU_VIEW, &worldM);
doesn't work right, but I am off and running again...
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

the GUM library uses sceGuSetMatrix() internally, so I doubt that's what at fault. Are you using sceGum* methods to draw aswell? In that case perhaps you have dirty data in the view-matrix that gets flushed when you render.
GE Dominator
Paco
Posts: 54
Joined: Sun Oct 09, 2005 6:53 pm

Post by Paco »

For what is worth, I'm using my old left-handed matrix code (from D3D engine) on the PSP successfully, zero changes were needed. X to the right, Y up, Z into the screen, which IIRC was the way D3D wanted it for W-Buffering.

Different coordinate systems suck.
Paco
Post Reply