Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DrawScene()
- {
- glClear(GL_COLOR_BUFFER_BIT);
- glBegin(GL_QUADS);
- double wsp_max=100.0f;
- glColor3f(1.0f, 1.0f, 1.0f);
- glVertex2f(-wsp_max, -wsp_max);
- //glColor3f(0.0f, 1.0f, 1.0f);
- glVertex2f(-wsp_max, wsp_max);
- //glColor3f(1.0f, 0.0f, 1.0f);
- glVertex2f(wsp_max, wsp_max);
- //glColor3f(0.0f, 1.0f, 1.0f);
- glVertex2f(wsp_max, -wsp_max);
- glColor3f(0.0f, 0.0f, 0.0f);
- glVertex2f(-wsp_max/3, -wsp_max/3);
- //glColor3f(0.0f, 0.0f, 0.0f);
- glVertex2f(-wsp_max/3, wsp_max/3);
- //glColor3f(0.0f, 0.0f, 1.0f);
- glVertex2f(wsp_max/3, wsp_max/3);
- //glColor3f(0.0f, 0.0f, 1.0f);
- glVertex2f(wsp_max/3, -wsp_max/3);
- double p;
- p=2*wsp_max/3;
- double s=1.f;
- s=2*wsp_max/9;
- double x;
- double y;
- for(int i =0; i<4; i++)
- {
- for(x=0; x<2*wsp_max; x=x+3*s)
- {
- for(y=0; y<2*wsp_max; y=y+3*s)
- {
- //glBegin(GL_QUADS);
- //glColor3f(0.0f, 1.0f, 0.0f);
- glVertex2f(-wsp_max+p/3+x, -wsp_max+p/3+y);
- //glColor3f(1.0f, 0.0f, 0.0f);
- glVertex2f(-wsp_max+p/3+x, -wsp_max+p/3+s+y);
- //glColor3f(1.0f, 0.0f, 1.0f);
- glVertex2f(-wsp_max+p/3+s+x, -wsp_max+p/3+s+y);
- //glColor3f(0.0f, 1.0f, 0.0f);
- glVertex2f(-wsp_max+p/3+s+x, -wsp_max+p/3+y);
- //glEnd();
- }
- }
- s/=3;
- p/=3;
- }
- glEnd();
- glFlush();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement