Problems building proper projection matrices..

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

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
turkeyman
Posts: 75
Joined: Wed Oct 20, 2004 7:38 pm
Location: Brisbane, Australia
Contact:

Problems building proper projection matrices..

Post by turkeyman »

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!
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

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.
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

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
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

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
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

Hmm I meant to tell you about it, I thought I had, but I probably forgot :)
Post Reply