#### Archived

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

# 3D Clipping

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

## Recommended Posts

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 on other sites
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

1. 1
Rutin
25
2. 2
3. 3
4. 4
5. 5

• 10
• 13
• 19
• 14
• 9
• ### Forum Statistics

• Total Topics
632943
• Total Posts
3009347
• ### Who's Online (See full list)

There are no registered users currently online

×