Skip to content

Instantly share code, notes, and snippets.

@EddyLuten
Created May 24, 2014 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EddyLuten/ec72946d18931268a873 to your computer and use it in GitHub Desktop.
Save EddyLuten/ec72946d18931268a873 to your computer and use it in GitHub Desktop.
Chapter 4, Issue 9 - OpenGLBook.com
// https://github.com/openglbook/openglbook.com/issues/9
const Vertex VERTICES[8] =
{
{ { -.5f, -.5f, .5f, 1 }, { 0, 0, 1, 1 } }, // 0 L down front
{ { -.5f, .5f, .5f, 1 }, { 1, 0, 0, 1 } }, // 1 L up front
{ { .5f, .5f, .5f, 1 }, { 0, 1, 0, 1 } }, // 2 R up front
{ { .5f, -.5f, .5f, 1 }, { 1, 1, 0, 1 } }, // 3 R down front
{ { -.5f, -.5f, -.5f, 1 }, { 1, 1, 1, 1 } }, // 4 L down back
{ { -.5f, .5f, -.5f, 1 }, { 1, 0, 0, 1 } }, // 5 L up back
{ { .5f, .5f, -.5f, 1 }, { 1, 0, 1, 1 } }, // 6 R up back
{ { .5f, -.5f, -.5f, 1 }, { 0, 0, 1, 1 } } // 7 R down back
};
const GLuint INDICES[36] =
{
// CCW
0, 2, 1, // tri 0 front face
0, 3, 2, // tri 1 front face
4, 3, 0, // tri 0 bottom face
4, 7, 3, // tri 1 bottom face
4, 1, 5, // tri 0 left face
4, 0, 1, // tri 1 left face
3, 6, 2, // tri 0 right face
3, 7, 6, // tri 1 right face
1, 6, 5, // tri 0 top face
1, 2, 6, // tri 1 top face
7, 5, 6, // tri 0 back face
7, 4, 5 // tri 1 back face
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment