public void Fill(DirectBitmap bitmap, IColourModel model) { foreach (Triangle trian in triangles) { trian.Fill(bitmap, model); } }
public void SetColourModel(IColourModel model) { foreach (Triangle trian in triangles) { trian.SetColourModel(model); } }
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))); } } } }
public void SetColourModel(IColourModel model) { colourModel = model.CreateCopy(); colourModel.SetTriangleContext(this); }
public void FillParalell(DirectBitmap bitmap, IColourModel model) { Parallel.ForEach(triangles, (trian) => trian.Fill(bitmap, model)); }
public ColourRenderer(IColourModel model, ShaderProgram shaderProgram) { this.model = model; this.shaderProgram = shaderProgram; }