Skip to content

Instantly share code, notes, and snippets.

@michaelfairley
Created May 18, 2016 12:50
Show Gist options
  • Save michaelfairley/12b812876c9e5cfa70701b7e75d52fdb to your computer and use it in GitHub Desktop.
Save michaelfairley/12b812876c9e5cfa70701b7e75d52fdb to your computer and use it in GitHub Desktop.
let cube = [
// Front
Vertex { position: [ 0.5, 0.5, 0.5], normal: [ 0.0, 0.0, 1.0] },
Vertex { position: [ 0.5, -0.5, 0.5], normal: [ 0.0, 0.0, 1.0] },
Vertex { position: [-0.5, 0.5, 0.5], normal: [ 0.0, 0.0, 1.0] },
Vertex { position: [-0.5, 0.5, 0.5], normal: [ 0.0, 0.0, 1.0] },
Vertex { position: [ 0.5, -0.5, 0.5], normal: [ 0.0, 0.0, 1.0] },
Vertex { position: [-0.5, -0.5, 0.5], normal: [ 0.0, 0.0, 1.0] },
// Back
Vertex { position: [ 0.5, 0.5, -0.5], normal: [ 0.0, 0.0, -1.0] },
Vertex { position: [-0.5, 0.5, -0.5], normal: [ 0.0, 0.0, -1.0] },
Vertex { position: [ 0.5, -0.5, -0.5], normal: [ 0.0, 0.0, -1.0] },
Vertex { position: [ 0.5, -0.5, -0.5], normal: [ 0.0, 0.0, -1.0] },
Vertex { position: [-0.5, 0.5, -0.5], normal: [ 0.0, 0.0, -1.0] },
Vertex { position: [-0.5, -0.5, -0.5], normal: [ 0.0, 0.0, -1.0] },
// Left
Vertex { position: [-0.5, 0.5, 0.5], normal: [-1.0, 0.0, 0.0] },
Vertex { position: [-0.5, -0.5, 0.5], normal: [-1.0, 0.0, 0.0] },
Vertex { position: [-0.5, 0.5, -0.5], normal: [-1.0, 0.0, 0.0] },
Vertex { position: [-0.5, 0.5, -0.5], normal: [-1.0, 0.0, 0.0] },
Vertex { position: [-0.5, -0.5, 0.5], normal: [-1.0, 0.0, 0.0] },
Vertex { position: [-0.5, -0.5, -0.5], normal: [-1.0, 0.0, 0.0] },
// Right
Vertex { position: [ 0.5, 0.5, 0.5], normal: [ 1.0, 0.0, 0.0] },
Vertex { position: [ 0.5, 0.5, -0.5], normal: [ 1.0, 0.0, 0.0] },
Vertex { position: [ 0.5, -0.5, 0.5], normal: [ 1.0, 0.0, 0.0] },
Vertex { position: [ 0.5, -0.5, 0.5], normal: [ 1.0, 0.0, 0.0] },
Vertex { position: [ 0.5, 0.5, -0.5], normal: [ 1.0, 0.0, 0.0] },
Vertex { position: [ 0.5, -0.5, -0.5], normal: [ 1.0, 0.0, 0.0] },
// Bottom
Vertex { position: [ 0.5, -0.5, 0.5], normal: [ 0.0, -1.0, 0.0] },
Vertex { position: [ 0.5, -0.5, -0.5], normal: [ 0.0, -1.0, 0.0] },
Vertex { position: [-0.5, -0.5, 0.5], normal: [ 0.0, -1.0, 0.0] },
Vertex { position: [-0.5, -0.5, 0.5], normal: [ 0.0, -1.0, 0.0] },
Vertex { position: [ 0.5, -0.5, -0.5], normal: [ 0.0, -1.0, 0.0] },
Vertex { position: [-0.5, -0.5, -0.5], normal: [ 0.0, -1.0, 0.0] },
// Top
Vertex { position: [ 0.5, 0.5, 0.5], normal: [ 0.0, 1.0, 0.0] },
Vertex { position: [-0.5, 0.5, 0.5], normal: [ 0.0, 1.0, 0.0] },
Vertex { position: [ 0.5, 0.5, -0.5], normal: [ 0.0, 1.0, 0.0] },
Vertex { position: [ 0.5, 0.5, -0.5], normal: [ 0.0, 1.0, 0.0] },
Vertex { position: [-0.5, 0.5, 0.5], normal: [ 0.0, 1.0, 0.0] },
Vertex { position: [-0.5, 0.5, -0.5], normal: [ 0.0, 1.0, 0.0] },
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment