add drawFilledCircle() and cap lines

This commit is contained in:
Josh Holtrop 2011-03-31 22:08:25 -04:00
parent e9735e03bf
commit 7fb5a06088

View File

@ -115,6 +115,13 @@ class SketchWidget:
glVertex(x1 + x_right, y1 + y_right) glVertex(x1 + x_right, y1 + y_right)
glVertex(x1 + x_left, y1 + y_left) glVertex(x1 + x_left, y1 + y_left)
glEnd() glEnd()
self.drawFilledCircle(x0, y0, size, 16)
self.drawFilledCircle(x1, y1, size, 16)
def drawFilledCircle(self, x, y, radius, steps): def drawFilledCircle(self, x, y, radius, steps):
pass glBegin(GL_TRIANGLE_FAN)
glVertex(x, y)
for i in range(steps + 1):
angle = i * 2 * math.pi / steps
glVertex(x + radius * math.cos(angle), y + radius * math.sin(angle))
glEnd()