Sign in to follow this  
supagu

clip space clip planes

Recommended Posts

im writing a software renderer, and im trying to get my head around clip space and clip planes. I did have clipping working in camera space (i think that might not be correct terminology, the space when you have clip space coords and then divide by the w component). Except the near plane was screwing up. So in camera space my clip planes were easy, each side of a unit cube. How ever in clip space, i need to somehow calculate the clip planes, and a method to determine the distance from the points to the plane. Its the w component that is screwing over my standard calculations for distance from point to a plane. google'ing for 'clip space' doesnt turn up much explanations :-/

Share this post


Link to post
Share on other sites
Your terminology is mixed up. You're currently clipping in clip space (called that becaue it is really easy to clip things using a unit cube) and you want to clip things in camera space (which is the space you're in before applying the projection matrix) or even world space (the space you're in before applying the camera/view matrix).

Google for "view frustrum".

Share this post


Link to post
Share on other sites
i cant do clipping before the projection matrix is applied, as my code is setup to run vertex shaders which apply the world * view * projection matrix to the vertices (like you would in a standard vertex shader).

Once these vertices have gone through this w * v * p matrix are they now in camera space? then once i do the divide by w they are in clip space? i thought it was the other way around.

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