Ejemplo n.º 1
0
 public override void Fill(OpenGL gl, bool mode)
 {
     if (mode)
     {
         base.Fill(gl, mode);
     }
     else //scanline
     {
         if (nPoly < 3)
         {
             return;
         }
         ScanFill     fillPolygon = new ScanFill();
         List <Point> p           = new List <Point>();
         for (int i = 0; i < nPoly; i++)
         {
             p.Add(nPoints[i]);
         }
         int cx = (p1.X + p2.X) / 2, cy = (p1.Y + p2.Y) / 2;
         gl.PushMatrix();
         gl.Translate(cx, cy, 0.0);
         gl.Rotate(Angle, 0.0, 0.0, 1.0);
         gl.Scale((double)(p2.X - p1.X) / (p2r.X - p1r.X), (double)(p2.Y - p1.Y) / (p2r.Y - p1r.Y), 0.0);
         gl.Color(FillColor.getR(), FillColor.getG(), FillColor.getB());
         fillPolygon.setFill(p);
         fillPolygon.initEdges();
         fillPolygon.scanlineFill(gl);
         gl.PopMatrix();
     }
 }