What's new

how do i clip triangles?

ashade

New member
I am making a function to clip tris via software, but I don't know how this stuff ocurrs... I have heard about near clipping plane, scissor, far clipping plane, etc... but I really have no idea what they do when clipping... can someone help me?
 

Cyberman

Moderator
Moderator
ashade said:
I am making a function to clip tris via software, but I don't know how this stuff ocurrs... I have heard about near clipping plane, scissor, far clipping plane, etc... but I really have no idea what they do when clipping... can someone help me?

There are a number of ways to do this. Basic 3d geometry. You find where the triangle intersects your cliping region and split it in the line going through the triangle. if the remaining surface has 4 edges you split it into 2 triangles and send those if it has 3 edges, then you have a smaller triangle and you send that instead.. however you will need to change UV mapping coordinates if a texture was being splatted on the triangle.

Cyb
 

sketzh

New member
ashade said:
I am making a function to clip tris via software, but I don't know how this stuff ocurrs... I have heard about near clipping plane, scissor, far clipping plane, etc... but I really have no idea what they do when clipping... can someone help me?

Do you want to clip your triangles against the viewfrustum, is that it ?
 

Top