
本文共 2799 字,大约阅读时间需要 9 分钟。
Processing���������������������������������������
���������������
Processing ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������
������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
������������
Processing���������������int tileSize = 40;void setup() { size(1200, 760); background(255); stroke(0); noFill(); noLoop();}void draw() { for(int i = 0; i < width; i += tileSize) { for(int j = 0; j < height; j += tileSize) { tileDraw(i, j); } }}void tileDraw(int x, int y) { boolean direction = random(0, 1) > 0.5; if(direction) { line(x, y, x + tileSize, y + tileSize); } else { line(x + tileSize, y, x, y + tileSize); }}void keyPressed() { if(key == 's' || key == 'S') { saveFrame("tiled_lines.png"); }}
���������������
������ tileSize
������������������������������������������������������������������������������������������
��� setup
������������������������������������������
��� draw
������������������������������������������������ tileSize
��������������������������������� tileDraw
������������������������
������ saveFrame
������������������������������������������������ S
������������
������������������������
-
������������������������������������������������������������������������������������������������������������
-
���������������������������
strokeWeight
������������������������������������������������������������ -
���������������������
animate
���������������������������������������������������������������
rabbit���������������
���������������������������������������������������������������������������������Manim���������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������������������������������������������������������
���������������������Manim���������������������������������������������������������������������������������������
������������������������������������������
发表评论
最新留言
关于作者
