Sign in to follow this  
maya18222

Negative near plane for Perspective matrix?

Recommended Posts

maya18222    194
Is this possible?

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.

Any ideas?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this