Function to convert a triangle to a vertex base index