I tried it with the DX api math library and it doesnt work as expected, so is there anyway of adapting the creation of of the perspective matrix?
The reason Im asking is because Im trying to draw lines that are drawn by transforming 3d points by a viewProj matrix, and then sending the XY values to a 2D line drawing library. This creates problems when one of the 3d points defining a line is behind the camera.
I could solve this by "sliding" the vertices to clip with the view frustum in 3d space, but im hoping the above would be an easier approach. Im not using the depth either, so precision isnt a problem.
Having a negative viewing plane doesn't really make sense, the viewing plane is representing your eyes essentially, a negative viewing plane would mean you are seeing things that are behind you at the same time as things that are infront of you; straight lines passing through z = 0 would not look like lines anymore; as things approach z = 0 the perspective transform moves things to infinity.
When you have things that are partially behind the camera, you have to clip the geometry to only render things that are infront of the camera plane
Edited by luca-deltodesco, 15 November 2012 - 05:55 AM.