Skip to content

Instantly share code, notes, and snippets.

@jblocksom
Last active December 20, 2015 03:59
Show Gist options
  • Save jblocksom/6067198 to your computer and use it in GitHub Desktop.
Save jblocksom/6067198 to your computer and use it in GitHub Desktop.
GLfloat vertices[] = {
// left side
-1.0, -1.0, -1.0,
-1.0, -1.0, 1.0,
-1.0, 1.0, -1.0,
-1.0, -1.0, 1.0,
-1.0, 1.0, -1.0,
-1.0, 1.0, 1.0,
// right side
1.0, -1.0, -1.0,
1.0, -1.0, 1.0,
1.0, 1.0, -1.0,
1.0, -1.0, 1.0,
1.0, 1.0, -1.0,
1.0, 1.0, 1.0,
// Bottom
-1.0, 1.0, -1.0,
-1.0, 1.0, 1.0,
1.0, 1.0, -1.0,
-1.0, 1.0, 1.0,
1.0, 1.0, -1.0,
1.0, 1.0, 1.0,
// Top
-1.0, -1.0, -1.0,
-1.0, -1.0, 1.0,
1.0, -1.0, -1.0,
-1.0, -1.0, 1.0,
1.0, -1.0, -1.0,
1.0, -1.0, 1.0,
};
GLfloat vertices[] = {
// left side
-1.0, -1.0, -1.0, 1.0, 0.0,
-1.0, -1.0, 1.0, 0.0, 0.0,
-1.0, 1.0, -1.0, 1.0, 1.0,
-1.0, -1.0, 1.0, 0.0, 0.0,
-1.0, 1.0, -1.0, 1.0, 1.0,
-1.0, 1.0, 1.0, 0.0, 1.0,
// right side
1.0, -1.0, -1.0, 0.0, 0.0,
1.0, -1.0, 1.0, 0.0, 1.0,
1.0, 1.0, -1.0, 1.0, 0.0,
1.0, -1.0, 1.0, 0.0, 1.0,
1.0, 1.0, -1.0, 1.0, 0.0,
1.0, 1.0, 1.0, 1.0, 1.0,
// Bottom
-1.0, 1.0, -1.0, 0.0, 0.0,
-1.0, 1.0, 1.0, 0.0, 1.0,
1.0, 1.0, -1.0, 1.0, 0.0,
-1.0, 1.0, 1.0, 0.0, 1.0,
1.0, 1.0, -1.0, 1.0, 0.0,
1.0, 1.0, 1.0, 1.0, 1.0,
// Top
-1.0, -1.0, -1.0, 0.0, 0.0,
-1.0, -1.0, 1.0, 0.0, 1.0,
1.0, -1.0, -1.0, 1.0, 0.0,
-1.0, -1.0, 1.0, 0.0, 1.0,
1.0, -1.0, -1.0, 1.0, 0.0,
1.0, -1.0, 1.0, 1.0, 1.0,
};
const int COORDS_PER_VERTEX = 5;
const int numVertices = sizeof(vertices) / (sizeof(GLfloat) * COORDS_PER_VERTEX);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment