示例#1
0
 public static void glEvalMesh2(MeshMode2 mode, Int32 i1, Int32 i2, Int32 j1, Int32 j2)
 {
     i_OpenGL1_0.glEvalMesh2(mode, i1, i2, j1, j2);
 }
示例#2
0
		public static void EvalMesh2(MeshMode2 mode, Int32 i1, Int32 i2, Int32 j1, Int32 j2)
		{
			Debug.Assert(Delegates.pglEvalMesh2 != null, "pglEvalMesh2 not implemented");
			Delegates.pglEvalMesh2((Int32)mode, i1, i2, j1, j2);
			CallLog("glEvalMesh2({0}, {1}, {2}, {3}, {4})", mode, i1, i2, j1, j2);
			DebugCheckErrors();
		}
示例#3
0
		internal static extern void glEvalMesh2(MeshMode2 mode, Int32 i1, Int32 i2, Int32 j1, Int32 j2);
示例#4
0
 internal static extern void glEvalMesh2(MeshMode2 mode, Int32 i1, Int32 i2, Int32 j1, Int32 j2);
示例#5
0
 public void EvalMesh2(MeshMode2 mode, int i1, int i2, int j1, int j2)
 {
     gl.glEvalMesh2((int)mode, i1, i2, j1, j2);
     CheckException();
 }
示例#6
0
文件: GL.cs 项目: Wiladams/NewTOAPIA
 public static void EvalMesh2(MeshMode2 mode, int i1, int i2, int j1, int j2)
 {
     gl.glEvalMesh2((int)mode, i1, i2, j1, j2);
 }
        private static void DrawTeapot(int grid, float scale, MeshMode2 type)
        {
            float[] p = new float[48], q = new float[48], r = new float[48], s = new float[48];
            int     i, j, k, l;

            GL.PushAttrib(AttribMask.EnableBit | AttribMask.EvalBit);
            GL.Enable(EnableCap.AutoNormal);
            GL.Enable(EnableCap.Normalize);
            GL.Enable(EnableCap.Map2Vertex3);
            GL.Enable(EnableCap.Map2TextureCoord2);

            // time for the math portion: remember augmented matrices?  here's where you use them!
            // prep the matrix for the data to be loaded
            GL.PushMatrix();
            // rotate the view
            GL.Rotate(270.0f, 1.0f, 0.0f, 0.0f);
            // set the size of the data
            GL.Scale(0.5f * scale, 0.5f * scale, 0.5f * scale);
            // move the data via X/Y/Z coordinates
            GL.Translate(0.0f, 0.0f, -1.5f);
            for (i = 0; i < 10; i++)
            {
                for (j = 0; j < 4; j++)
                {
                    for (k = 0; k < 4; k++)
                    {
                        for (l = 0; l < 3; l++)
                        {
                            p[j * 12 + k * 3 + l] = cpdata[patchdata[i, j * 4 + k], l];
                            q[j * 12 + k * 3 + l] = cpdata[patchdata[i, j * 4 + (3 - k)], l];
                            if (l == 1)
                            {
                                q[j * 12 + k * 3 + l] *= -1.0f;
                            }
                            if (i < 6)
                            {
                                r[j * 12 + k * 3 + l] = cpdata[patchdata[i, j * 4 + (3 - k)], l];
                                if (l == 0)
                                {
                                    r[j * 12 + k * 3 + l] *= -1.0f;
                                }
                                s[j * 12 + k * 3 + l] = cpdata[patchdata[i, j * 4 + k], l];
                                if (l == 0)
                                {
                                    s[j * 12 + k * 3 + l] *= -1.0f;
                                }
                                if (l == 1)
                                {
                                    s[j * 12 + k * 3 + l] *= -1.0f;
                                }
                            }
                        }
                    }
                }

                // high level math for the texture coordinates
                GL.Map2(MapTarget.Map2TextureCoord2, 0f, 1f, 2, 2, 0f, 1f, 4, 2, tex);
                // high level math for the vertices
                GL.Map2(MapTarget.Map2Vertex3, 0f, 1f, 3, 4, 0f, 1f, 12, 4, p);
                // high level math for a 2 dimensional map
                GL.MapGrid2(grid, 0.0, 1.0, grid, 0.0, 1.0);
                // high level math to do the evaluation of the grids
                GL.EvalMesh2(type, 0, grid, 0, grid);
                // high level math for the vertices
                GL.Map2(MapTarget.Map2Vertex3, 0, 1, 3, 4, 0, 1, 12, 4, q);
                // high level math to do the evaluation of the grids
                GL.EvalMesh2(type, 0, grid, 0, grid);
                if (i < 6)
                {
                    // high level math for the vertices
                    GL.Map2(MapTarget.Map2Vertex3, 0, 1, 3, 4, 0, 1, 12, 4, r);
                    // high level math to do the evaluation of the grids
                    GL.EvalMesh2(type, 0, grid, 0, grid);
                    // high level math for the vertices
                    GL.Map2(MapTarget.Map2Vertex3, 0, 1, 3, 4, 0, 1, 12, 4, s);
                    // high level math to do the evaluation of the grids
                    GL.EvalMesh2(type, 0, grid, 0, grid);
                }
            }

            // release the manipulated data from the matrix
            GL.PopMatrix();
            // release the manipulated data from the matrix attributes
            GL.PopAttrib();
        }
示例#8
0
        private static void DrawTeapot(int grid, float scale, MeshMode2 type)
        {
            float[] p = new float[48], q = new float[48], r = new float[48], s = new float[48];
              int i, j, k, l;

              GL.PushAttrib(AttribMask.EnableBit | AttribMask.EvalBit);
              GL.Enable(EnableCap.AutoNormal);
              GL.Enable(EnableCap.Normalize);
              GL.Enable(EnableCap.Map2Vertex3);
              GL.Enable(EnableCap.Map2TextureCoord2);
              GL.PushMatrix();
              GL.Rotate(270.0f, 1.0f, 0.0f, 0.0f);
              GL.Scale(0.5f * scale, 0.5f * scale, 0.5f * scale);
              GL.Translate(0.0f, 0.0f, -1.5f);
              for (i = 0; i < 10; i++)
              {
            for (j = 0; j < 4; j++)
            {
              for (k = 0; k < 4; k++)
              {
            for (l = 0; l < 3; l++)
            {
              p[j * 12 + k * 3 + l] = cpdata[patchdata[i, j * 4 + k], l];
              q[j * 12 + k * 3 + l] = cpdata[patchdata[i, j * 4 + (3 - k)], l];
              if (l == 1)
                q[j * 12 + k * 3 + l] *= -1.0f;
              if (i < 6)
              {
                r[j * 12 + k * 3 + l] = cpdata[patchdata[i, j * 4 + (3 - k)], l];
                if (l == 0)
                  r[j * 12 + k * 3 + l] *= -1.0f;
                s[j * 12 + k * 3 + l] = cpdata[patchdata[i, j * 4 + k], l];
                if (l == 0)
                  s[j * 12 + k * 3 + l] *= -1.0f;
                if (l == 1)
                  s[j * 12 + k * 3 + l] *= -1.0f;
              }
            }
              }
            }

            GL.Map2(MapTarget.Map2TextureCoord2, 0f, 1f, 2, 2, 0f, 1f, 4, 2, tex);
            GL.Map2(MapTarget.Map2Vertex3, 0f, 1f, 3, 4, 0f, 1f, 12, 4, p);
            GL.MapGrid2(grid, 0.0, 1.0, grid, 0.0, 1.0);
            GL.EvalMesh2(type, 0, grid, 0, grid);
            GL.Map2(MapTarget.Map2Vertex3, 0, 1, 3, 4, 0, 1, 12, 4, q);
            GL.EvalMesh2(type, 0, grid, 0, grid);
            if (i < 6)
            {
              GL.Map2(MapTarget.Map2Vertex3, 0, 1, 3, 4, 0, 1, 12, 4, r);
              GL.EvalMesh2(type, 0, grid, 0, grid);
              GL.Map2(MapTarget.Map2Vertex3, 0, 1, 3, 4, 0, 1, 12, 4, s);
              GL.EvalMesh2(type, 0, grid, 0, grid);
            }
              }

              GL.PopMatrix();
              GL.PopAttrib();
        }
 public static extern void EvalMesh2( MeshMode2 mode, int i1, int i2, int j1, int j2 );