Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1.  
  2.     GLfloat vdata[] =
  3.     {
  4.         -X,  0.0,  Z,
  5.          X,  0.0,  Z,
  6.         -X,  0.0, -Z,
  7.         0.0,   Z,  X,
  8.         0.0,   Z, -X,
  9.         0.0,  -Z,  X,
  10.         0.0,  -Z, -X,
  11.           Z,   X, 0.0,
  12.          -Z,   X, 0.0,
  13.           Z,  -X, 0.0,
  14.          -Z,  -X, 0.0
  15.     };
  16.  
  17.     GLuint tindicies[] =
  18.     {
  19.         1,4,0,
  20.         4,9,0,
  21.         4,5,9,
  22.         8,5,4,
  23.         1,8,4,
  24.         1,10,8,
  25.         10,3,8,
  26.         8,3,5,
  27.         3,2,5,
  28.         3,7,2,
  29.         3,10,7,
  30.         10,6,7,
  31.         6,11,7,
  32.         6,0,11,
  33.         6,1,0,
  34.         10,1,6,
  35.         11,0,9,
  36.         2,11,9,
  37.         5,2,9,
  38.         11,2,7
  39.     };
  40.  
  41.     glEnableClientState(GL_VERTEX_ARRAY);
  42.     glVertexPointer(3, GL_FLOAT, 0, vdata);
  43.  
  44.     glClear(GL_COLOR_BUFFER_BIT); /* clear */
  45.     {
  46.         glDrawElements(GL_TRIANGLES, 36, GL_FLOAT, tindicies);
  47.     }
  48.     glFlush();
  49.     glutSwapBuffers(); /* For double-buffering */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement