Exemple #1
0
        private void BuildStrip(Strip Strip)
        {
            uint Start = Strip.Start;

            bool     ClockWise = false;
            TriOrder Order     = Strip.Order;

            //Create a new strip
            PrimitiveBrawl p = new PrimitiveBrawl(PrimType.TriangleStrip);

            m_PrimitivesVector.Add(p);
            AddTriangle(m_Triangles[Start].m_Elem, Order, true);
            MarkTriAsTaken(Start);

            //Loop while we can further extend the strip
            var Node = m_Triangles[Start];

            for (uint Size = 1; Size < Strip.Size; Size++)
            {
                var Link = LinkToNeighbour(Node, ClockWise, ref Order, true);

                Debug.Assert(Link != null);

                //Go to the next triangle
                Node = Link.Terminal;
                MarkTriAsTaken(Node.m_Elem.m_Index);
                ClockWise = !ClockWise;
            }
        }
Exemple #2
0
        private void AddRemainingTriangles()
        {
            //Create the last indices array and fill it with all the triangles that couldn't be stripped
            PrimitiveBrawl p = new PrimitiveBrawl(PrimType.TriangleList);

            for (uint i = 0; i < m_Triangles.Count; i++)
            {
                if (!m_Triangles[i].Marked)
                {
                    p.Indices.Add(m_Triangles[i].m_Elem.A);
                    p.Indices.Add(m_Triangles[i].m_Elem.B);
                    p.Indices.Add(m_Triangles[i].m_Elem.C);
                }
            }

            if (p.Indices.Count > 0)
            {
                m_PrimitivesVector.Add(p);
            }
        }