Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonathan Feinberg
committed
Sep 9, 2010
1 parent
b994f5a
commit 3f7a922
Showing
2 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
Scale Shape. | ||
Illustration by George Brower. | ||
(Rewritten in Python by Jonathan Feinberg.) | ||
Move the mouse left and right to zoom the SVG file. | ||
This shows how, unlike an imported image, the lines | ||
remain smooth at any size. | ||
""" | ||
|
||
# The file "bot1.svg" must be in the data folder | ||
# of the current sketch to load successfully | ||
bot = loadShape("bot1.svg") | ||
|
||
def setup(): | ||
size(640, 360) | ||
smooth() | ||
|
||
def draw(): | ||
background(102) | ||
translate(width / 2, height / 2) | ||
zoom = map(mouseX, 0, width, 0.1, 4.5) | ||
scale(zoom) | ||
shape(bot, -140, -140) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.