p5.js中的动态羽毛波浪脸
来自 Wikiprompt,自由的提示词百科全书
p5.js中的动态羽毛波浪脸 这是一个使用p5.js生成动态面部效果的草图,通过羽毛状波动线条和发光笔触营造视觉动感。
相关媒体
提示词内容收藏
🌐
function setup() {
createCanvas(400, 400);
background(0);
}
function draw() {
background(0, 15); // Smooth fading for trails
noFill();
stroke(255, 120); // Soft glowing white
translate(width / 2, height / 2); // Center the face
// Face outline (wave shape)
drawFeatherWave(0, 0, 100, 1.0);
// Eyes (two small waves)
drawFeatherWave(-30, -20, 20, 2.0);
drawFeatherWave(30, -20, 20, 2.0);
// Mouth (small curved wave)
drawFeatherWave(0, 30, 40, 1.5);
}
// Custom function: draws a feather-like wave
function drawFeatherWave(cx, cy, radius, freq) {
push();
translate(cx, cy);
for (let angle = 0; angle < TWO_PI; angle += 0.3) {
beginShape();
for (let i = -20; i <= 20; i += 2) {
let r = radius + sin(i * 0.2 + frameCount * 0.03) * 5;
let x = cos(angle) * (r + i);
let y = sin(angle) * (r + i);
y += sin(i * 0.3 + frameCount * 0.05) * 10 * freq;
vertex(x, y);
}
endShape();
}
pop();
}
用法
此提示词专为 creative 设计。复制上方内容并粘贴到你常用的 AI 工具中。
为获得最佳效果,可将占位符(方括号或大写字母标示)替换为你的具体需求。
讨论
0 条评论