Triangle fill algorithm

Hi guys

I need a fast algorithm that fills a 2D triangle. I’m not using Graphics or Graphics2D for this.
This is what I want:


class ColorBuffer {
   private int[][] data;
   public void plot(int x,int y,int color) {
      data[x][y]=color;
   }
   // some other methods
}
class Renderer {
   public ColorBuffer buffer;
   // [...]
   public void fillTriangle(Point v1,Point v2,Point v3) {
      // that's what I need
   }
}

Please include a source code if you can. :slight_smile: