Skip to content

Instantly share code, notes, and snippets.

@jblocksom
Created October 29, 2013 21:13
Show Gist options
  • Save jblocksom/7222704 to your computer and use it in GitHub Desktop.
Save jblocksom/7222704 to your computer and use it in GitHub Desktop.
GLfloat boxVerts[] = {
// 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,
};
const int COORDS_PER_VERTEX = 3;
GLfloat boxVerts[] = {
// 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment