Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <GL\glut.h>
- #include <math.h>
- using namespace std;
- #define PI 3.14159265
- void rysunek2(float r, float kat)
- {
- float rozmiar=360/kat;
- float przyrost = kat;
- glBegin(GL_LINES);
- glColor3f(1,0,0);
- for(int i=0;i<rozmiar;i++)
- {
- glVertex3f(r*cos(kat),r*sin(kat),0);
- kat+=3.6;
- glVertex3f(r*cos(kat),r*sin(kat),0);
- }
- glEnd();
- }
- void Display()
- {
- glClearColor(0,0,0,0);
- glClear(GL_COLOR_BUFFER_BIT);
- rysunek2(0.8,3.6);
- glFlush();
- glutSwapBuffers();
- }
- int _tmain(int argc, char* argv[])
- {
- glutInit( &argc, argv);
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
- glutInitWindowPosition(190,100);
- glutInitWindowSize(600 ,600);
- glutCreateWindow("lekcja2");
- glutDisplayFunc(Display);
- glMatrixMode(GL_PROJECTION);
- glutMainLoop();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment