2018年1月18日 星期四

James的圖學筆記Week15

Part1.Antialias

1.Alias(鋸齒)
2.Antialias(反鋸齒)
3.Dither(抖動)

James的圖學筆記Week14

光柵化

Part1.繪製三角形

mode1.描邊
size(600,600,P3D);
background(255);
beginShape(TRIANGLE);
  stroke(255,0,0);vertex(300,100);
  stroke(255,255,0);vertex(500,500);
  stroke(0,0,255);vertex(100,500);
endShape();

mode2.填滿
size(600,600,P3D);
background(255);
beginShape(TRIANGLE);
  fill(255,0,0);vertex(300,100);//顏色填滿
  fill(255,255,0);vertex(500,500);//顏色填滿
  fill(0,0,255);vertex(100,500);//顏色填滿
endShape();

mode3.重疊
void setup()
{size(600,600,P3D);
}
void draw()
{
background(255);
beginShape(TRIANGLE);
beginShape(TRIANGLE);
fill(255,0,0);vertex(100,100,0);
fill(255,0,255);vertex(100,500,100);
fill(255,255,0);vertex(500,500,0);
endShape();
beginShape(TRIANGLE);
fill(0,255,0);vertex(500,100,0);
fill(0,255,255);vertex(500,500,100);
fill(255,255,0);vertex(100,500,0);
endShape();
}








James的圖學筆記Week13

Part1.AR
Part2.Processing 色彩模式

1.RGB
size(255,255);
colorMode(RGB,255);
for(int x=0;x<255;x++)
{
    for(int y=0;y<255;y++)
    {
      stroke(x,y,255);
      point(x,y);
    }
}
2.HSB
size(255,255);
colorMode(HSB,255);
for(int x=0;x<255;x++)
{
    for(int y=0;y<255;y++)
    {
      stroke(x,y,255);
      point(x,y);
    }
}

part3.多重貼圖

下載roach.zip