Cube.cpp
Upload User: sz83729876
Upload Date: 2013-03-07
Package Size: 4140k
Code Size: 1k
Category:

OpenGL program

Development Platform:

Windows_Unix

  1. //
  2. // a64ki
  3. // Copyright (c) 2002 Henrik Carlgren
  4. // http://ziruz.cjb.net
  5. // ziruz@hotpop.com
  6. //
  7. #include "cube.h"
  8. #include <windows.h>
  9. #include <glgl.h>
  10. void renderCube(float size)
  11. {
  12. glBegin(GL_QUADS);
  13. glVertex3f(-size,-size,-size);
  14. glVertex3f(-size,+size,-size);
  15. glVertex3f(+size,+size,-size);
  16. glVertex3f(+size,-size,-size);
  17. glVertex3f(-size,-size,+size);
  18. glVertex3f(-size,+size,+size);
  19. glVertex3f(+size,+size,+size);
  20. glVertex3f(+size,-size,+size);
  21. glVertex3f(-size,-size,-size);
  22. glVertex3f(-size,-size,+size);
  23. glVertex3f(+size,-size,+size);
  24. glVertex3f(+size,-size,-size);
  25. glVertex3f(-size,+size,-size);
  26. glVertex3f(-size,+size,+size);
  27. glVertex3f(+size,+size,+size);
  28. glVertex3f(+size,+size,-size);
  29. glVertex3f(-size,-size,-size);
  30. glVertex3f(-size,-size,+size);
  31. glVertex3f(-size,+size,+size);
  32. glVertex3f(-size,+size,-size);
  33. glVertex3f(+size,-size,-size);
  34. glVertex3f(+size,-size,+size);
  35. glVertex3f(+size,+size,+size);
  36. glVertex3f(+size,+size,-size);
  37. glEnd();
  38. }