Processing学习(一)

来源:互联网 发布:音视频网络编码器 编辑:程序博客网 时间:2024/05/21 09:37

Processing学习(一)

属性

  1. size(width,height);窗口大小
  2. smooth();光滑
  3. nosmooth();
  4. noStroke();无外框
  5. strokeWeight(10);框厚度
  6. strokeJoin(ROUND);框效果
  7. strokeJoin(BEVEL);框效果
  8. strokeCap(SQUARE);框效果
  9. strokeCap(ROUND);框效果


颜色属性

  • background(R,G,B);背景颜色
  • fill(R,G,B,alpha);颜色填充
  • nofill();透明
  • stroke(R,G,B,alpha);边框颜色
    • alpha:0~100透明度 
    • 0:完全透明
    • R,G,B=0~255
    • 0:black  255:white

形状

  • point( x , y );点
  • line(x1,y1,x2,y2); 线
  • triangle(x1,y1,x2,y2,x3,y3); 三角形
  • quad(x1,y1,x2,y2,x3,y3,x4,y4); 四边形
  • rect(x,y,width,height);长方形
  • ellipse(x,y,width,height);圆
  • arc(x,y,width,height,start,stop);扇形

    arc->ex:

    x轴右方为0,顺时针

    HALF_PI=radians(90)

    size(480,120);

    arc(90,60, 80, 80, 0, HALF_PI);

    arc(190,60, 80, 80, 0, PI+HALF_PI);

    arc(290,60, 80, 80, PI, TWO_PI+HALF_PI);

    arc(390,60, 80, 80, QUARTER_PI, PI+QUARTER_PI);


    size(480,120);

    arc(90,60, 80, 80, 0, radians(90));

    arc(190,60, 80, 80, 0, radians(270));

    arc(290,60, 80, 80, radians(180), radians(450));

    arc(390,60, 80, 80, radians(45), radians(225));

  • 多边形
    • beginShape();
    • vertex(180,82);
    • vertex(207,36);
    • vertex(214,63);
    • vertex(407,11);
    • endShape(CLOSE);







0 0
原创粉丝点击