コード例 #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;
 }