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 

Problems building proper projection matrices..

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



Joined: 20 Oct 2004
Posts: 75
Location: Brisbane, Australia

PostPosted: Sat Jul 16, 2005 6:37 pm    Post subject: Problems building proper projection matrices.. Reply with quote

Hey everyone,

I'm trying to sort out my projection matrix but its giving me a little trouble, is there good docs about the transformation pipeline anywhere?

the guardband is throwing me a little too reguarding viewports and stuff.. and i'm having trouble figuring out what space the result of the projection should actually map to..

I'm building an ortho and a projection matrix similar to the calculations listed in the d3d docs and opengl. (RH/LH differences asside) but the resulting image on the screen appears as if its stretched over a much larger area than the visible screen..

the cube demo calculates its projection matrix almost the same as i am, and not surprisingly, that demo actually draw's a different image than the data building the matrix would have you think.. (when compared to the same thing running on ps/linux/xbox)

ie, i build an ortho matrix with an ortho range from 0,0 to 640x480.. when i render vertices, the top left point seems to be far above and left of the top left corder of the screen, likewise for the bottom right...
my perspective projections are the same, the rendered image is stretched to fix a larger area than the screen... so is the PSP fitting the result of the projection to the buardband or is there something i need to compensate for when building the matrices? what operations does the psp perform post projection?

again, a detailed description of the transformation pipeline would be really useful :)

thanks again guys!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ector



Joined: 12 May 2005
Posts: 195

PostPosted: Sun Jul 17, 2005 3:57 am    Post subject: Reply with quote

Yeah, chip-nat has his scaling factors wrong. In the VIEWPORT registers, he writes 480 and -272 where puzzle bobble writes 240 and -136, according to my emulator. Those values are what I use and they give correct dimensions.
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Sun Jul 17, 2005 6:26 am    Post subject: Reply with quote

ector wrote:
Yeah, chip-nat has his scaling factors wrong. In the VIEWPORT registers, he writes 480 and -272 where puzzle bobble writes 240 and -136, according to my emulator. Those values are what I use and they give correct dimensions.


Good thing I read these forums, otherwise I would miss the bug-reports.. :) I'll fix sceGuViewport() right away, I'll just verify that I messed up like that first. ;)
_________________
GE Dominator
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Sun Jul 17, 2005 6:50 am    Post subject: Reply with quote

Ok, sceGuViewport() has been fixed. This will break all the 3D-apps in development out these using pspgu, but better break them now than later. :)

I also updated all the samples using the transform-pipe to compensate for this new viewport.
_________________
GE Dominator
Back to top
View user's profile Send private message
ector



Joined: 12 May 2005
Posts: 195

PostPosted: Sun Jul 17, 2005 6:54 am    Post subject: Reply with quote

Hmm I meant to tell you about it, I thought I had, but I probably forgot :)
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