Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
kurse:efcomputergrafik:kw36 [2019/09/04 15:10] Marcel Metzler [Callbacks] |
kurse:efcomputergrafik:kw36 [2019/09/04 15:14] (current) Marcel Metzler [Callbacks] |
||
---|---|---|---|
Line 194: | Line 194: | ||
clear() | clear() | ||
move(x,y) | move(x,y) | ||
- | text("Die Mouse wurde gedrückt" | + | text("Eine Mausetaste |
def onMouseReleased(x, | def onMouseReleased(x, | ||
clear() | clear() | ||
move(x,y) | move(x,y) | ||
- | text(" | + | text(" |
def onMouseDragged(x, | def onMouseDragged(x, | ||
clear() | clear() | ||
move(x,y) | move(x,y) | ||
- | text(" | + | text(" |
makeGPanel(mousePressed = onMousePressed, | makeGPanel(mousePressed = onMousePressed, | ||
Line 253: | Line 253: | ||
it=0 | it=0 | ||
while it< | while it< | ||
- | z = z**2 + c # hoch zwei durch drei, vier usw. ersetzen und | + | z = z**2 + c |
- | it=it+1 | + | it=it+1 |
- | if abs(z) > R: # Divergenz | + | if abs(z) > R: |
return it | return it | ||
return maxIterations | return maxIterations | ||
Line 275: | Line 275: | ||
c = complex(x, | c = complex(x, | ||
itCount = Mandelbrot(c) | itCount = Mandelbrot(c) | ||
- | if itCount == maxIterations: | + | if itCount == maxIterations: |
setColor(" | setColor(" | ||
- | else: # outside Mandelbrot set | + | else: |
| | ||
point(c) | point(c) |