2020年10月26日 星期一

week07 07161116 張勝彥

 畫圖形


void setup()

{

size(500,500);

}

void draw()

{

beginShape();

for(int angle=0;angle<360;angle+=120)

{

    float angle2= radians(angle+mouseX);

    float x = 100+cos(angle2)*50;

    float y = 100+sin(angle2)*50;

    vertex(x,y);

}


endShape(CLOSE);

}


1hr=60min,1min=60sec,1sec=60ftames

frameCount:第幾個frame

角度有兩種:degree度(360度的世界)

sin()cos()用radions弧度/經度(PI世界)

切水果

Java的陣列 vs C陣列 float fruitX[10];


沒有留言:

張貼留言