Hey all,
I’ve been banging my head against this problem all day, so I guess it’s time to call in the cavalry. ![]()
I’m working on a game that requires an oblique (forced depth) camera view and I can’t for the life of me figure out the correct projection matrix. My many attempts have centered around taking a standard orthographic projection and modifying the third column of the first two rows of the matrix (as shown in the Wikipedia article on Cabinet Projection) so that the x and y coordinates are projected at a fixed angle based upon the z coordinate. While this does force all of the scene geometry to be rendered from the desired oblique perspective, the view frustum gets all messed up. And by all messed up, I mean being translated several hundred units away from the camera’s origin point for no apparent reason.
This is shown both in Unity’s Scene view and by the values returned from the screen-to-world coordinate conversion functions. Oddly enough, this doesn’t affect the rendering at all, which has led me to believe that I’m improperly constructing the projection matrix in a way that OpenGL/Direct3D is fine with but Unity’s internal matrix math isn’t so keen on.
I’m hoping that some kind soul can spare some sample code showing a working (in Unity) oblique projection matrix, or at least point me in the right direction for understanding projection matrices better. ![]()