draw axes
This commit is contained in:
parent
edbfce91d2
commit
bfe8d2a267
@ -77,6 +77,8 @@ class SketchWidget:
|
|||||||
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
|
||||||
|
|
||||||
|
self.drawAxes()
|
||||||
|
|
||||||
for shape in self.sketch:
|
for shape in self.sketch:
|
||||||
if isinstance(shape, Line):
|
if isinstance(shape, Line):
|
||||||
self.drawLine(shape, 1.5)
|
self.drawLine(shape, 1.5)
|
||||||
@ -159,3 +161,11 @@ class SketchWidget:
|
|||||||
angle = i * 2 * math.pi / steps
|
angle = i * 2 * math.pi / steps
|
||||||
glVertex(x + radius * math.cos(angle), y + radius * math.sin(angle))
|
glVertex(x + radius * math.cos(angle), y + radius * math.sin(angle))
|
||||||
glEnd()
|
glEnd()
|
||||||
|
|
||||||
|
def drawAxes(self):
|
||||||
|
glPushAttrib(GL_CURRENT_BIT)
|
||||||
|
glColor(1.0, 0.4, 0.4, 1.0)
|
||||||
|
cx, cy = self.ptToScreenPt((0, 0))
|
||||||
|
self.drawFilledLine(cx - 25, cy, cx + 25, cy, 1.5)
|
||||||
|
self.drawFilledLine(cx, cy - 25, cx, cy + 25, 1.5)
|
||||||
|
glPopAttrib()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user