Пример #1
0
 public void Fill(DirectBitmap bitmap, IColourModel model)
 {
     foreach (Triangle trian in triangles)
     {
         trian.Fill(bitmap, model);
     }
 }
Пример #2
0
 public void SetColourModel(IColourModel model)
 {
     foreach (Triangle trian in triangles)
     {
         trian.SetColourModel(model);
     }
 }
Пример #3
0
        public void Fill(DirectBitmap bitmap, IColourModel model)
        {
            ActiveLineList aet = new ActiveLineList(points);

            List <Point> scanLine;

            while (aet.Increment())
            {
                scanLine = aet.GetPointsOnScanLine();
                var it = scanLine.GetEnumerator();
                while (it.MoveNext())
                {
                    Point one = it.Current;
                    it.MoveNext();
                    Point two = it.Current;
                    for (int x = one.X; x <= two.X; ++x)
                    {
                        bitmap.SetPixel(x, one.Y, colourModel.GetColor(new Point(x, one.Y)));
                    }
                }
            }
        }
Пример #4
0
 public void SetColourModel(IColourModel model)
 {
     colourModel = model.CreateCopy();
     colourModel.SetTriangleContext(this);
 }
Пример #5
0
 public void FillParalell(DirectBitmap bitmap, IColourModel model)
 {
     Parallel.ForEach(triangles, (trian) => trian.Fill(bitmap, model));
 }
Пример #6
0
 public ColourRenderer(IColourModel model, ShaderProgram shaderProgram)
 {
     this.model         = model;
     this.shaderProgram = shaderProgram;
 }