Skip to content

Instantly share code, notes, and snippets.

@sixman9
Created March 2, 2011 16:02
Show Gist options
  • Save sixman9/851154 to your computer and use it in GitHub Desktop.
Save sixman9/851154 to your computer and use it in GitHub Desktop.
How to draw a cube using 13 Triangle Strip vertices.
How to draw a Cube with OpenGL's Triangle strip (non-Vertex buffer object example, 13 vertices)
gl.glBegin(gl.GL_TRIANGLESTRIP);
gl.glVertex(100,100,−100);
gl.glVertex(100,300,−100);
gl.glVertex(300,300,−100);
gl.glVertex(300,300,−300);
gl.glVertex(300,100,−300);
gl.glVertex(100,100,−100);
gl.glVertex(100,100,−300);
gl.glVertex(100,300,−300);
gl.glVertex(100,300,−100);
gl.glVertex(100,300,−100);
gl.glVertex(100,300,−300);
gl.glVertex(100,100,−300);
gl.glVertex(300,100,−300);
gl.glEnd();
@maktf
Copy link

maktf commented Jan 21, 2016

Are you kidding me

@chose2
Copy link

chose2 commented Oct 20, 2016

It does'nt work at all

@capnslipp
Copy link

Nope.

screen shot 2017-03-08 at 9 11 42 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment