add drawFilledCircle() and cap lines
This commit is contained in:
parent
e9735e03bf
commit
7fb5a06088
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user