User Tools

Site Tools


journal:201312

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
journal:201312 [2013/12/29 08:43] – created dongheejournal:201312 [2018/07/18 14:10] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +
 +====== 12월 29일 ======
 +
 +
 +flock
 +
 +<code>
 +from nodebox.graphics import *
 +from nodebox.graphics.physics import Flock
 +
 +flock = Flock(20, 0, 0, 500, 500)
 +flock.sight = 500
 +
 +def draw(canvas):
 + background(1)
 + fill(0, 0.75)
 + flock.update(cohesion=0.15)
 + for boid in flock:
 + push()
 + translate(boid.x, boid.y)
 + scale(0.5 + 1.5 * boid.depth)
 + rotate(boid.heading)
 + arrow(0, 0, 15)
 + star(0,0, 10,50,20)
 + pop()
 +
 +canvas.fps=30
 +canvas.size = 600, 400
 +canvas.run(draw)
 +</code>
 +
 +music21, rtmidi
 +
 <code> <code>
 import time import time
journal/201312.1388306584.txt.gz · Last modified: 2018/07/18 14:09 (external edit)