Slide 12
Slide 12 text
jgs
Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 12
void myDisplay(void) {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glPushMatrix();
/* draw 1 */
glBegin(GL_POLYGON); // fill connected polygon
glColor3f(1.0f, 0.843f, 0.0f);
glVertex2f(-0.7, 0.7); // vertices of the triangl 1
glVertex2f(0.6, 0.7);
glVertex2f(-0.7, -0.6);
glEnd();
/* draw 2 */
glRotatef((GLfloat)year, 0.0, 0.0, 1.0);
glTranslatef(2.0, 0.0, 0.0);
glRotatef((GLfloat)day, 0.0, 1.0, 0.0);
glBegin(GL_POLYGON);
glColor3f(1.0f, 0.843f, 0.0f);
glVertex2f(0.7, 0.6); // vertices of the triangle 2
glVertex2f(-0.6, -0.7);
glVertex2f(0.7, -0.7);
glEnd();
glPopMatrix();
glFlush();
}