From 8558f449f6887d285f037cc5ef962cc69280fd53 Mon Sep 17 00:00:00 2001 From: Zhao Xin <7176466@qq.com> Date: Fri, 6 Jan 2023 11:00:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=B3=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 16.平移.html | 82 +++++++++++++++++++++++++++++++++++++++++++++ TEST.html | 93 +++++++++++++++++++++++++++++----------------------- lib/utils.js | 6 ++-- 3 files changed, 137 insertions(+), 44 deletions(-) create mode 100644 16.平移.html diff --git a/16.平移.html b/16.平移.html new file mode 100644 index 0000000..7c17d71 --- /dev/null +++ b/16.平移.html @@ -0,0 +1,82 @@ + + + + + + + + 平移 + + + + + + + +
+ + diff --git a/TEST.html b/TEST.html index 8af4a22..7c17d71 100644 --- a/TEST.html +++ b/TEST.html @@ -5,62 +5,73 @@ - 向日葵 + 平移 diff --git a/lib/utils.js b/lib/utils.js index ca31c60..e92a038 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -21,13 +21,13 @@ function playdemos(list, delay = 10) { func(); } -function drawGrid(color = 255, fade = 32) { +function drawGrid(color = 255, fade = 32, offset = 10) { push(); colorMode(RGB); stroke(color, fade); strokeWeight(1); - for (let x = 0; x < width; x += 10) line(x, 0, x, height); - for (let y = 0; y < height; y += 10) line(0, y, width, y); + for (let x = 0; x < width; x += offset) line(x, 0, x, height); + for (let y = 0; y < height; y += offset) line(0, y, width, y); pop(); }