Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

3D Clipping

This topic is 6631 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
I am having difficulty implementing 3D clipping using view frustrum where the view angle is non-standard (i.e. not 90 degrees). I am going to do the clipping prior to rendering. The initial direction that I am taking is doing line-plane intersection to determine where each of the planes of the view frustrum interesects the lines created by the vertices of the n-poly, the problem I have is then what? Some of the planes will intersect the line determined by the vertices outside of the poly (since both the line and the plane extend infinitely) and for those it seems like it would be a waste to do the original interesction calculation, but I don't know how I can differentiate. Also, how do you determine which vertices to replace after you find an intersection between the plane and line? Depending on how the plane intersects the poly you could either after to replace the first vertice or the second vertice in the line that was used to determine the intersection.

I know this is potentially huge question, so any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Oke, here goes:

First clip your polys against the near and far plane (just like with the viewfrustum planes). This should eliminate any problems with planes extended to infinity. I'm assuming you know how to calculate the intersection (if any) between a linepiece and a plane. I solved adding vertices by looping through the polys vertices and copying the vertices (including intersections) to a new clipped poly. You need the unclipped version anyway and adding vertices to an existing poly structure (array/linked list) is allways hell.

Mail me if you have any further questions:
krebbers@casema.net

Jeroen

Share this post


Link to post
Share on other sites