public VertexModel ToVertexModel() { var output = new VertexModel(); Tesselate(output); return(output); }
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); } }
public ModelBuilder() { model = new VertexModel(); tesselator = new LineTesselator(model); }
public LineTesselator(VertexModel output) : base(output) { firstIndices = null; lastIndices = null; }
public Tesselator(VertexModel output) { this.Output = output; }