Performs the actual drawing in drawTriangle.