Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. void RenderScene(void)
  2. {
  3. GLfloat x,y,z,angle; // Zmienne do przechowywania położeń punktów
  4. glClear(GL_COLOR_BUFFER_BIT); // Wyczyść okno
  5.  
  6. // Zachowaj stan macierzy i wykonaj rotację
  7. glPushMatrix();
  8. glRotatef(xRot, 1.0f, 0.0f, 0.0f);
  9. glRotatef(yRot, 0.0f, 1.0f, 0.0f);
  10. // Definiuj prymityw
  11. glBegin(GL_POINTS);
  12. z = -50.0f;
  13. for(angle = 0.0f; angle <= (2.0f*GL_PI)*3.0f; angle += 0.1f)
  14. {
  15. x = 50.0f*sin(angle);
  16. y = 50.0f*cos(angle);
  17. // Podaj położenie punktu i przesuń współrzędną z punktu
  18. glVertex3f(x, y, z);
  19. z += 0.5f;
  20. }
  21. // Zakończ rysowanie punktu
  22. glEnd();
  23. // Przywróć transformacje
  24. glPopMatrix();
  25. glFlush();
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement