public Edge(Rasterizer rasterizer, Vertex[] buffer, int index1, int index2)
            {
                this.buffer = buffer;

                var coords1 = rasterizer.GetBackBufferCoordinates(buffer[index1].Position);
                var coords2 = rasterizer.GetBackBufferCoordinates(buffer[index2].Position);

                if (coords1.Y < coords2.Y)
                {
                    this.index1 = index1;
                    this.index2 = index2;
                    X1          = coords1.X;
                    Y1          = coords1.Y;
                    X2          = coords2.X;
                    Y2          = coords2.Y;
                }
                else
                {
                    this.index1 = index2;
                    this.index2 = index1;
                    X2          = coords1.X;
                    Y2          = coords1.Y;
                    X1          = coords2.X;
                    Y1          = coords2.Y;
                }
            }
예제 #2
0
 public Renderer(Buffer <Vector4F> target)
 {
     this.rasterizer = new Rasterizer(target, 2);
     this.target     = target;
 }