Skip to content

Commit

Permalink
Make transforms example static
Browse files Browse the repository at this point in the history
  • Loading branch information
rlafuente committed May 1, 2018
1 parent c773084 commit 6fcf824
Showing 1 changed file with 31 additions and 33 deletions.
64 changes: 31 additions & 33 deletions examples/basic/transforms.bot
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
# about:
# Perform some basic transformations (rotation and translation) on rectangles.

def setup():
size(300,500)
background(0.2)

fill(1, 0.2)
stroke(1, 0.5)

transform(CENTER)

translate(100,100)

def draw():
for i in range(6):
push()
rotate(i * 15)
rect(0, 0, 80, 80)
pop()

translate(0, 100)

for i in range(6):
push()
scale(i / 6.)
rect(0, 0, 80, 80)
pop()

translate(0, 100)

for i in range(6):
push()
skew(i / 3.)
rect(0, 0, 80, 80)
pop()
size(300,500)
background(0.2)

fill(1, 0.2)
stroke(1, 0.5)

transform(CENTER)

translate(100,100)

for i in range(6):
push()
rotate(i * 15)
rect(0, 0, 80, 80)
pop()

translate(0, 100)

for i in range(6):
push()
scale(i / 6.)
rect(0, 0, 80, 80)
pop()

translate(0, 100)

for i in range(6):
push()
skew(i / 3.)
rect(0, 0, 80, 80)
pop()

0 comments on commit 6fcf824

Please sign in to comment.