Path: chuka.playstation.co.uk!news From: James Russell Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Accessing screen translated vertices Date: Sun, 02 Nov 1997 18:41:28 +1300 Organization: PlayStation Net Yaroze (SCEE) Lines: 46 Message-ID: <345C1288.E288E7A@ibm.net> References: <345BFB81.51488BFC@ibm.net> NNTP-Posting-Host: slip202-135-86-87.ak.nz.ibm.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.01 [en] (Win95; I) X-Priority: 3 (Normal) James Russell wrote: > > GsSetLs() sets up the GTE and GsSortObject uses that info to create the > GPU packets necessary - but I just want to convert them to screen > coordinates, not draw the 3D image. > > I'm guessing this wouldn't be too hard to do by hand - I've got access > to the vertices and all the necessary matrices. But since there's a > dedicated GTE ready to tackle all that nasty matrix work for me, I > figured SOMEONE must know how to do it. D'oh! I guessed wrong. This is Not As Easy As I Thought. My understanding of the subject is as follows: Each object has a coordinate Matrix, which specifies it's rotation in X,Y,Z and it's translation. Each object also has a 'super' object (for heirachal coord systems) which I don't care about since mine is in the World. You also have a view point, looking from some point in the world in some direction. In order to see anything, you've got to: o Translate all your vertices/normals into WORLD space. o Translate all your vertices/normals from World space to SCREEN space. o Perform the perspective transformation on each vertex to get the screen position. Now, what puzzles me is how the PSX does all this. It's not very clear to me what GsSetLw/GsGetLs/etc do, and how they work is a mystery. Since I have to do the above process by hand, can anyone give me a hint as to what the algorithm is? I'm also assuming I'm going to need a matrix which transforms between World and Screen space. However, my object is stuck at a (0,0,0) in world space, and that's what my screen is looking at (from 0,0,-1000), so AFAIK World space = Screen space. As yet, my efforts are turning up zilch. Is there any internal scaling done? Also, I'm assuming that the perspective transform (for x) is: ScreenX = PROJECTION_DISTANCE * ScreenCoord.x * (PROJECTION_DISTANCE + ScreenCoord.z); (Where ScreenCoord is the record holding the X,Y,Z of the point in screen space). Cheers, J