GLfloat point[4][3] =...{...{-2,0,0},...{-1,2,0},...{1,-2,0},...{2,0,0}}; int InitGL(GLvoid) // All Setup For OpenGL Goes Here ...{ glShadeModel(GL_SMOOTH); // Enable Smooth Shading glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background glClearDepth(1.0f); // Depth Buffer Setup glEnable(GL_DEPTH_TEST); // Enables Depth Testing glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations glMap1f(GL_MAP1_VERTEX_3,0,1,3,4,(GLfloat *)point); glEnable(GL_MAP1_VERTEX_3); return TRUE; // Initialization Went OK } int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing ...{ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer glLoadIdentity(); // Reset The Current Modelview Matrix glColor3f(1,1,1); glBegin(GL_LINE_STRIP); for (int i =0;i <=30;i++) glEvalCoord1f(i /30.0); glEnd(); return TRUE; // Everything Went OK }
float point[4][4][3] =...{...{...{-2,0,2},...{-1,2,2},...{1,-2,2},...{2,0,2}}, ...{...{-2,0,1},...{-1,2,1},...{1,-2,1},...{2,0,1}}, ...{...{-2,0,0},...{-1,2,0},...{1,-2,0},...{2,0,0}}, ...{...{-2,0,-1},...{-1,2,-1},...{1,-2,-1},...{2,0,-1}}}; int InitGL(GLvoid) // All Setup For OpenGL Goes Here ...{ glShadeModel(GL_SMOOTH); // Enable Smooth Shading glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background glClearDepth(1.0f); // Depth Buffer Setup glEnable(GL_DEPTH_TEST); // Enables Depth Testing glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations if (!LoadTexture()) returnfalse; glEnable(GL_TEXTURE_2D); glMap2f(GL_MAP2_VERTEX_3,0,1,3,4,0,1,12,4,(GLfloat *)point); glEnable(GL_MAP2_VERTEX_3); glEnable(GL_AUTO_NORMAL); glMap2f(GL_MAP2_TEXTURE_COORD_2,0,1,2,2,0,1,2,4,(GLfloat *)TexPt); glEnable(GL_MAP2_TEXTURE_COORD_2); glMapGrid2f(20,0,1,20,0,1); return TRUE; // Initialization Went OK } int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing ...{ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer glLoadIdentity(); // Reset The Current Modelview Matrix glTranslatef(0,0,zoom); glRotatef(xRot,1,0,0); if (bLine) glEvalMesh2(GL_FILL,0,20,0,20); else glEvalMesh2(GL_LINE,0,20,0,20); glPointSize(5); glColor3f(1,1,1); return TRUE; // Everything Went OK }