# How to create projection/view matrix for hole in the monitor effect

Lets say I have my XNA app window that is sized at 640 x 480 pixels. Now lets say I have a cube model with its poly's facing in to make a room. This cube is sized 640 units wide by 480 units high by 480 units deep. Lets say the camera is somewhere in front of the box looking at it.

How can I set up the view and projection matrices such that the front edge of the box lines up exactly with the edges of the application window?

It seems like this should probably involve the Matrix.CreatePerspectiveOffCenter method, but I don't fully understand how the parameters translate on to the screen.

For reference, the end result will be something like Johhny Lee's wii head tracking demo: http://www.youtube.com/watch?v=Jd3-eiid-Uw&feature=player_embedded

P.S. I realize that his source code is available, but I am afraid I haven't been able to make heads or tails out of it.

(None of this advice is specific to the XNA function you named; it applies equally well to e.g. glFrustum. I don't know XNA.)