Esempio n. 1
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);
            }
        }
Esempio n. 2
0
        protected void AddQuad(uint a, uint b, uint c, uint d)
        {
            var quadIndices = new uint[] { a, b, c, a, c, d };

            Output.AddIndices(quadIndices);
        }