Skip to content

Instantly share code, notes, and snippets.

@zeffii
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/8784007 to your computer and use it in GitHub Desktop.
Save zeffii/8784007 to your computer and use it in GitHub Desktop.
# for simplicity represent 2d vectors using 2-tuple floats
points = [(20.0, 20.0), (70.0, 20.0), (70.0, 70.0)]
gl_col = (0.2, 0.9, 0.2, .2)
bgl.glBegin(bgl.GL_POINTS)
bgl.glColor4f(*gl_col)
# for each vector in points, call bgl.glVertex2f
for vector2d in points:
bgl.glVertex2f(*vector2d) # needs a 2d input
bgl.glEnd()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment