示例#1
0
        public VertexModel ToVertexModel()
        {
            var output = new VertexModel();

            Tesselate(output);
            return(output);
        }
示例#2
0
        public void Tesselate(VertexModel output)
        {
            var firstIdx = output.AddVertexes(Vertexes);
            var lastIdx  = firstIdx + Vertexes.Count;

            // We triangulate a convex poly just by drawing lines from the first point to
            // all the others...
            for (uint i = firstIdx + 2; i < lastIdx; i++)
            {
                var tri = new uint[] {
                    firstIdx, i - 1, i
                };
                output.AddIndices(tri);
            }
        }
示例#3
0
 public ModelBuilder()
 {
     model      = new VertexModel();
     tesselator = new LineTesselator(model);
 }
示例#4
0
 public LineTesselator(VertexModel output) : base(output)
 {
     firstIndices = null;
     lastIndices  = null;
 }
示例#5
0
 public Tesselator(VertexModel output)
 {
     this.Output = output;
 }