Skip to content

Instantly share code, notes, and snippets.

@alfredoem
Last active October 30, 2020 21:48
Show Gist options
  • Save alfredoem/0241ba5e7e77ea380f2bced3d85010ff to your computer and use it in GitHub Desktop.
Save alfredoem/0241ba5e7e77ea380f2bced3d85010ff to your computer and use it in GitHub Desktop.
OPENGL primivites example
// rectangle
glColor3f(0.0,0.0,1.0);
glBegin(GL_QUADS);
glVertex2i(7, 4);// arriba derecha - top right
glVertex2i(-7, 4);// arriba izquierda - top left
glVertex2i(-7, 0);// abajo izquierda - bottom left
glVertex2i(7, 0);// abajo derecha - bottom right
glEnd();
// square
glColor3f(0.0,0.0,1.0);
glBegin(GL_QUADS);
glVertex2i(5, 5);// arriba derecha
glVertex2i(-5, 5);// arriba izquierda
glVertex2i(-5, -5);// abajo izquierda
glVertex2i(5, -5);// abajo derecha
glEnd();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment