CgExamples.Gl_06_vertex_twisting.drawSubDividedTriangle C# (CSharp) Méthode

drawSubDividedTriangle() static private méthode

Large vertex displacements such as are possible with C3E4v_twist require a high degree of tessellation. This routine draws a triangle recursively subdivided to provide sufficient tessellation.
static private drawSubDividedTriangle ( int subdivisions ) : void
subdivisions int
Résultat void
        static void drawSubDividedTriangle(int subdivisions)
        {
            float[] a = { -0.8f, 0.8f },
                        b = { 0.8f, 0.8f },
                        c = { 0.0f, -0.8f },
                        ca = { 0f, 0f, 1f },
                        cb = { 0f, 0f, 1f },
                        cc = { 0.7f, 0.7f, 1f };

            Gl.glBegin(Gl.GL_TRIANGLES);
            triangleDivide(subdivisions, a, b, c, ca, cb, cc);
            Gl.glEnd();
        }