forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Coordinate system

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Mon Sep 19, 2005 2:52 pm    Post subject: Coordinate system Reply with quote

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?
Back to top
View user's profile Send private message
0x0001



Joined: 21 Jul 2005
Posts: 11

PostPosted: Tue Sep 20, 2005 10:53 am    Post subject: Reply with quote

yes cordinates are x across y down
same as ps2

480 pixels for x
272 for y
Back to top
View user's profile Send private message Send e-mail
RustyFunkNut



Joined: 26 Sep 2005
Posts: 17
Location: London, UK

PostPosted: Mon Sep 26, 2005 5:32 am    Post subject: Reply with quote

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 :)
Back to top
View user's profile Send private message MSN Messenger
CyberBill



Joined: 26 Jul 2005
Posts: 86
Location: Redmond, WA

PostPosted: Mon Sep 26, 2005 5:48 am    Post subject: Reply with quote

PSP Matrices are directly in line with OpenGL matrices, but yes, D3D matrices have their axis reversed.
Back to top
View user's profile Send private message AIM Address MSN Messenger
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Thu Sep 29, 2005 9:54 am    Post subject: Reply with quote

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:
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:
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!!
Back to top
View user's profile Send private message
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Thu Sep 29, 2005 10:26 am    Post subject: Reply with quote

Ok, so after taking a different approach I see that I can use:
Code:
sceGumMatrixMode(GU_VIEW);
sceGumLoadMatrix(&worldM);

Which seems to work better. I don't know why
Code:
sceGuSetMatrix(GU_VIEW, &worldM);

doesn't work right, but I am off and running again...
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Thu Sep 29, 2005 5:45 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Paco



Joined: 09 Oct 2005
Posts: 54

PostPosted: Tue Oct 11, 2005 9:22 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group