Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void RenderScene(void)
- {
- GLfloat x,y,z,angle; // Zmienne do przechowywania położeń punktów
- glClear(GL_COLOR_BUFFER_BIT); // Wyczyść okno
- // Zachowaj stan macierzy i wykonaj rotację
- glPushMatrix();
- glRotatef(xRot, 1.0f, 0.0f, 0.0f);
- glRotatef(yRot, 0.0f, 1.0f, 0.0f);
- // Definiuj prymityw
- glBegin(GL_POINTS);
- z = -50.0f;
- for(angle = 0.0f; angle <= (2.0f*GL_PI)*3.0f; angle += 0.1f)
- {
- x = 50.0f*sin(angle);
- y = 50.0f*cos(angle);
- // Podaj położenie punktu i przesuń współrzędną z punktu
- glVertex3f(x, y, z);
- z += 0.5f;
- }
- // Zakończ rysowanie punktu
- glEnd();
- // Przywróć transformacje
- glPopMatrix();
- glFlush();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement