Skip to content

Instantly share code, notes, and snippets.

@dennda
Created September 8, 2011 01:48
Show Gist options
  • Save dennda/1202405 to your computer and use it in GitHub Desktop.
Save dennda/1202405 to your computer and use it in GitHub Desktop.
// Vertices drawn as GL_TRIANGLE_STRIP:
GLfloat d = 0.5f;
// We have 4 verts * 3 coords = 12 elements per slice
const GLfloat one_slice[12] = {
// x, y, z
-d, d, 0.,
d, d, 0.,
-d, -d, 0.,
d, -d, 0.,
};
// modelview projection:
float dim = 2.f;
GLKMatrix4 projectionMatrix = GLKMatrix4MakeOrtho(-dim, dim,
-dim, dim,
-dim, dim);
float axdist = 1.f;
GLKMatrix4 modelViewMatrix = GLKMatrix4MakeLookAt(axdist, axdist, axdist,
0., 0., 0.,
0., 1., 0.);
_modelViewProjectionMatrix = GLKMatrix4Multiply(projectionMatrix, modelViewMatrix);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment