View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# 3D Clipping

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

### #1Anonymous Poster_Anonymous Poster_*  Guests

Posted 19 October 1999 - 10:30 AM

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.

### #2Anonymous Poster_Anonymous Poster_*  Guests

Posted 19 October 1999 - 10:30 AM

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

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.