コード例 #1
0
        internal static void  RenderLonelyTriangles(GLUtessellatorImpl tess, Mogre.Utils.GluTesselator.GLUface f)
        {
            /* Now we render all the separate triangles which could not be
             * grouped into a triangle fan or strip.
             */
            Mogre.Utils.GluTesselator.GLUhalfEdge e;
            int newState;
            int edgeState = -1;              /* force edge state output for first vertex */

            tess.callBeginOrBeginData(GL.GL_TRIANGLES);

            for (; f != null; f = f.trail)
            {
                /* Loop once for each edge (there will always be 3 edges) */

                e = f.anEdge;
                do
                {
                    if (tess.flagBoundary)
                    {
                        /* Set the "edge state" to true just before we output the
                         * first vertex of each edge on the polygon boundary.
                         */
                        newState = (!e.Sym.Lface.inside)?1:0;
                        if (edgeState != newState)
                        {
                            edgeState = newState;
                            tess.callEdgeFlagOrEdgeFlagData(edgeState != 0);
                        }
                    }
                    tess.callVertexOrVertexData(e.Org.data);

                    e = e.Lnext;
                }while (e != f.anEdge);
            }
            tess.callEndOrEndData();
        }
コード例 #2
0
ファイル: Render.cs プロジェクト: agustinsantos/mogregis3d
        internal static void RenderLonelyTriangles(GLUtessellatorImpl tess, Mogre.Utils.GluTesselator.GLUface f)
        {
            /* Now we render all the separate triangles which could not be
            * grouped into a triangle fan or strip.
            */
            Mogre.Utils.GluTesselator.GLUhalfEdge e;
            int newState;
            int edgeState = - 1; /* force edge state output for first vertex */

            tess.callBeginOrBeginData(GL.GL_TRIANGLES);

            for (; f != null; f = f.trail)
            {
                /* Loop once for each edge (there will always be 3 edges) */

                e = f.anEdge;
                do
                {
                    if (tess.flagBoundary)
                    {
                        /* Set the "edge state" to true just before we output the
                        * first vertex of each edge on the polygon boundary.
                        */
                        newState = (!e.Sym.Lface.inside)?1:0;
                        if (edgeState != newState)
                        {
                            edgeState = newState;
                            tess.callEdgeFlagOrEdgeFlagData(edgeState != 0);
                        }
                    }
                    tess.callVertexOrVertexData(e.Org.data);

                    e = e.Lnext;
                }
                while (e != f.anEdge);
            }
            tess.callEndOrEndData();
        }