Skip to content

Instantly share code, notes, and snippets.

@gabrielflorit
Last active June 6, 2018 02:46
Show Gist options
  • Save gabrielflorit/97a3948d2c0f243c055785815c8daeba to your computer and use it in GitHub Desktop.
Save gabrielflorit/97a3948d2c0f243c055785815c8daeba to your computer and use it in GitHub Desktop.
SCRIPT-8
// title: Polystroke shutter
initialState = {
r: 0
}
update = s => {
s.r += 1
}
draw = s => {
clear()
const i = 16 * Math.sin(s.r * Math.PI / 180)
range(7).forEach(j => {
polyStroke(
[[16, 54 - i], [64, 64 - i], [16, 64 + i]],
j * 51 + s.r / i,
64 - i / 4,
64 + i / 4,
j
)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment