예제 #1
0
 protected override void Draw(Matrix view, Matrix Projection, RenderHelper render, PrimitiveBatch batch)
 {
     batch.Begin(PrimitiveType.LineList, view, Projection);
     foreach (var item in lines)
     {
         batch.AddVertex(item, color);
     }
     batch.End();
 }
예제 #2
0
        protected override void Draw(Matrix view, Matrix Projection, RenderHelper render, PrimitiveBatch batch)
        {
            if (fill == false)
            {
                render.PushRasterizerState(state);
            }

            batch.Begin(PrimitiveType.TriangleList, view, Projection);
            foreach (var item in point)
            {
                batch.AddVertex(item, color);
            }
            batch.End();

            render.PopRasterizerState();
        }
        protected override void Draw(Matrix view, Matrix Projection, RenderHelper render, PrimitiveBatch batch)
        {
            if (fill == false)
            {
                render.PushRasterizerState(state);
            }

            if (point.Count < 3)
            {
                throw new InvalidOperationException("Need at least 3 points to make a triangle strip");
            }

            batch.Begin(PrimitiveType.TriangleStrip, view, Projection);
            foreach (var item in point)
            {
                batch.AddVertex(item, color);
            }
            batch.End();

            if (fill == false)
            {
                render.PopRasterizerState();
            }
        }