互动媒体技术A1作业报告
A1實驗技術(shù)報告
- function文件
- 1. function ellipse_drawStdFace_0128(x, y, rate)
- 2. function line_ao_0128(x0, y0, xstep, ystep, num)
- 3. function line_flower_0128(x, y, angle, radius1, radius2, velocity)
- 4. function line_noise_0128(x, y, lineArray, lineNum, controlPointNum)
- 5. function line_apple_0128(r, n, x, y)
- 6. function line_BW_0128(y, XN, YN, XL, YL)
- 7. function line_heart_0128()
- 8. function frameRate_line_0128()
- 9 class Pendulun
- rainbow文件
- 1. rainbow_line_0128_1(x, y)
- 2. function rainbow_ellipse_0128(x, y)
- Processing
- 海綿寶寶
- 粒子效果分享
function文件
1. function ellipse_drawStdFace_0128(x, y, rate)
效果:笑臉,并根據(jù)鼠標(biāo)位置放大縮小。
擴(kuò)展:對ellipse進(jìn)行了擴(kuò)展,畫出來了笑臉
2. function line_ao_0128(x0, y0, xstep, ystep, num)
效果:笑臉和凹凸線,并根據(jù)鼠標(biāo)位置拉伸(放大)收縮(縮小)
擴(kuò)展:對ellipse,line進(jìn)行了擴(kuò)展,畫出來了笑臉,并放在凹凸線上。
3. function line_flower_0128(x, y, angle, radius1, radius2, velocity)
效果:一個可以根據(jù)鼠標(biāo)位置調(diào)節(jié)變化快慢的花團(tuán)形狀。
擴(kuò)展:貝塞爾曲線和ellipse的應(yīng)用
4. function line_noise_0128(x, y, lineArray, lineNum, controlPointNum)
效果:一個根據(jù)噪聲形成的不斷變化的曲線。可以調(diào)節(jié)曲線數(shù)量,密度,抖動情況。
擴(kuò)展:對繪制多邊形流程進(jìn)行了擴(kuò)展,用了random函數(shù)。
5. function line_apple_0128(r, n, x, y)
效果:一個用線組成的花環(huán)形狀。
擴(kuò)展:對line,正余弦函數(shù)進(jìn)行了擴(kuò)展
6. function line_BW_0128(y, XN, YN, XL, YL)
效果:多條類似斑馬線的線條形狀,可以調(diào)節(jié)線條數(shù)量,并根據(jù)鼠標(biāo)位置改變變化的快慢。
擴(kuò)展:對rect函數(shù)的擴(kuò)展
7. function line_heart_0128()
效果:一個可以根據(jù)鼠標(biāo)移動的心得形狀。
擴(kuò)展:對bezierVertex的擴(kuò)展。
8. function frameRate_line_0128()
效果:一條根據(jù)幀數(shù)變化而形成的心率線。
擴(kuò)展:對line的擴(kuò)展。
9 class Pendulun
效果:模擬重力,摩擦力,加速度,角速度做出的擺錘效果。并根據(jù)彩虹色漸變。
擴(kuò)展:對ellipse ,line ,rect的擴(kuò)展
rainbow文件
1. rainbow_line_0128_1(x, y)
效果:按下鼠標(biāo)中鍵,會有多條根據(jù)柏林噪音形成的不斷變化的線。
根據(jù)彩虹色進(jìn)行漸變。
擴(kuò)展:noise,line函數(shù)的擴(kuò)展。
2. function rainbow_ellipse_0128(x, y)
效果:一個根據(jù)柏林噪聲不斷抖動的漸變色球。根據(jù)彩虹色變化。
擴(kuò)展:對noise,ellipse函數(shù)的擴(kuò)展
Processing
海綿寶寶
用代碼畫的海綿寶寶。
粒子效果分享
int num = 1000;//the number of point(s). float mts = PI/24;//max theta speed. int r = 100;//radius of the circle int rdtr = 5;//range of the rdt int rdu = 1;//radius of circle //********** PVector v[]=new PVector[num]; boolean mv = true; boolean mo = true; color c[] = new color[num];//color of each point. float theta[] = new float[num];//original angle of each point. float mtheta[] = new float[num];//translate angle to math value. float dtheta[] = new float[num];//speed of theta. float easing[] = new float[num]; int rdt[] = new int[num];//make a shuffle of radius. void setup() {colorMode(RGB,255,255,255);size(650,650);for(int i =0;i<num-1;i++){c[i] = color(random(100,200),random(100,200),random(100,200));v[i] = new PVector(random(width),random(height));theta[i] = round(random(360));dtheta[i] = random(mts);mtheta[i] = theta[i]/180*PI;rdt[i] = round(random(-rdtr,rdtr));easing[i] = random(0.02,0.3);}frameRate(60); } void draw() {fill(25,25,25,25);rect(0,0,width,height);pushMatrix();noStroke();if(mv){if(mo){for(int i = 0;i<num-1;i++){mtheta[i] += dtheta[i];v[i].lerp(mouseX+cos(mtheta[i])*(rdt[i]+r), mouseY+sin(mtheta[i])*(rdt[i]+r),0,easing[i]);fill(c[i]);ellipse(v[i].x, v[i].y, rdu,rdu);}}if(!mo){for(int i = 0;i<num-1;i++){v[i].lerp(mouseX+cos(mtheta[i])*(rdt[i]+r), mouseY+sin(mtheta[i])*(rdt[i]+r),0,easing[i]);fill(c[i]);ellipse(v[i].x, v[i].y, rdu,rdu);}}}if(!mv){if(mo){for(int i = 0;i<num-1;i++){mtheta[i] += dtheta[i];v[i].lerp(mouseX+cos(mtheta[i])*rdt[i], mouseY+sin(mtheta[i])*rdt[i],0,easing[i]);fill(c[i]);ellipse(v[i].x, v[i].y, rdu,rdu);}}if(!mo){for(int i = 0;i<num-1;i++){v[i].lerp(mouseX+cos(mtheta[i])*rdt[i], mouseY+sin(mtheta[i])*rdt[i],0,easing[i]);fill(c[i]);ellipse(v[i].x, v[i].y, rdu,rdu);}}}popMatrix();fill(0);rect(0,0,width,15);fill(255);textAlign(LEFT,TOP);text("r = "+r,0,0);text("fps = "+round(frameRate),40,0);if(mv){fill(255,0,0);text("Running",100,0);}if(!mv){text("Static",100,0);}if(mo) {fill(255,0,0);text("motion",150,0);}if(!mo){fill(255);text("stop",150,0);} } void mousePressed(){/*for(int i = 0;i<num-1;i++){v[i] = new PVector(random(width),random(height));theta[i] = round(random(360));mtheta[i] = theta[i]/180*PI;dtheta[i] = random(mts);rdt[i] = round(random(-rdtr,rdtr)+r);}*/mv = !mv; } void keyPressed(){if(key == 's'||key == 'S'){mo =!mo;} } void mouseWheel(MouseEvent event){float e = event.getCount();if(e == -1) r+=10;if(e == 1) r-=10; }總結(jié)
以上是生活随笔為你收集整理的互动媒体技术A1作业报告的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: muduo网络库:09---多线程服务器
- 下一篇: 多线程服务器的典型适用场合