还是通过一个程序来记忆其中的知识,我很喜欢这种学习方式
运行结果如图:
#include <windows.h>
#include <gl\glut.h>
#include <gl\GLU.h>
#include <gl\GL.h>
#include <math.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#define PI 3.1415926
int WinWidth, WinHeight;
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 0.0, 0.0);
glLoadIdentity();
//画分割线(点画线),分成四个视见区
glLineStipple(2,0xAAAA);
glEnable(GL_LINE_STIPPLE);
glLineWidth(10);
glViewport(0, 0, WinWidth, WinHeight);
glBegin(GL_LINES);
glVertex2f(-1.0, 0);
glVertex2f(1.0, 0);
glVertex2f(0.0, -1.0);
glVertex2f(0.0, 1.0);
glEnd();
glDisable(GL_LINE_STIPPLE);