triangles: Better API.
triangles: Don't forget to transform normals.

This fixes the artifacts seen when rendering meshes.
triangles: Use a different implementation for flat and smooth triangles.