OpenGL


5. 3D - 2


glColor3f(1.0f,0.0f,0.0f);//

glVertex3f( 0.0f, 1.0f, 0.0f);// ()

glColor3f(0.0f,1.0f,0.0f);//

glVertex3f(-1.0f,-1.0f, 1.0f);//

glColor3f(0.0f,0.0f,1.0f);//

glVertex3f( 1.0f,-1.0f, 1.0f);//

. , , Y, X. .

, . , , . .

, glBegin(GL_TRIANGLES) glEnd(), . , OpenGL , . , , OpenGL , . , OpenGL . . , .

glColor3f(1.0f,0.0f,0.0f);//

glVertex3f( 0.0f, 1.0f, 0.0f);// ()

glColor3f(0.0f,0.0f,1.0f);//

glVertex3f( 1.0f,-1.0f, 1.0f);// ()

glColor3f(0.0f,1.0f,0.0f);//

glVertex3f( 1.0f,-1.0f, -1.0f);// ()