Processing制作好看图片

这篇博客介绍了如何利用Processing编程语言创建吸引人的图像。通过代码示例,展示了Processing在视觉艺术和图形设计中的应用。
摘要由CSDN通过智能技术生成

代码实现如下:

float r = 120;
void setup() {
  size(500, 500);
}

void draw() {
  background(0);
  pushMatrix();
  translate(width/2, height/2);
  noFill();
  stroke(255, 50);
  ellipse(0, 0, r*2, r*2);

  //中间的圆球
  for (float i=0; i<80; i+=0.05) {
    float t = i+random(0.1, PI);
    float x1 = r * cos(i);
    float y1 = r * sin(i);
    float x2 = r * cos(t);
    float y2 = r * sin(t);
    line(x1, y1, x2, y2);
  }
  //外圆-正向倾斜
  float r2 = r+50;
  ellipse(0, 0, r2, r2);
  for (float i=0; i<40; i+=0.1) {
    float t = i+random(0.1, PI/2);
    float r_tmp = random(r+35,r2);
    float x1 = r * cos(i);
    float y1 = r * sin(i);
    float x2 = r_tmp * cos(t);
    float y2 = r_tmp * sin(t);
    line(x1, y1, x2, y2);
    fill(
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值