Triangulate
Download MATLAB code and powerpoint:
triangulate.zip
2D example
3D example