互动媒体技术A1作业报告
生活随笔
收集整理的這篇文章主要介紹了
互动媒体技术A1作业报告
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
A1實驗技術報告
- 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)
效果:笑臉,并根據鼠標位置放大縮小。
擴展:對ellipse進行了擴展,畫出來了笑臉
2. function line_ao_0128(x0, y0, xstep, ystep, num)
效果:笑臉和凹凸線,并根據鼠標位置拉伸(放大)收縮(縮小)
擴展:對ellipse,line進行了擴展,畫出來了笑臉,并放在凹凸線上。
3. function line_flower_0128(x, y, angle, radius1, radius2, velocity)
效果:一個可以根據鼠標位置調節變化快慢的花團形狀。
擴展:貝塞爾曲線和ellipse的應用
4. function line_noise_0128(x, y, lineArray, lineNum, controlPointNum)
效果:一個根據噪聲形成的不斷變化的曲線。可以調節曲線數量,密度,抖動情況。
擴展:對繪制多邊形流程進行了擴展,用了random函數。
5. function line_apple_0128(r, n, x, y)
效果:一個用線組成的花環形狀。
擴展:對line,正余弦函數進行了擴展
6. function line_BW_0128(y, XN, YN, XL, YL)
效果:多條類似斑馬線的線條形狀,可以調節線條數量,并根據鼠標位置改變變化的快慢。
擴展:對rect函數的擴展
7. function line_heart_0128()
效果:一個可以根據鼠標移動的心得形狀。
擴展:對bezierVertex的擴展。
8. function frameRate_line_0128()
效果:一條根據幀數變化而形成的心率線。
擴展:對line的擴展。
9 class Pendulun
效果:模擬重力,摩擦力,加速度,角速度做出的擺錘效果。并根據彩虹色漸變。
擴展:對ellipse ,line ,rect的擴展
rainbow文件
1. rainbow_line_0128_1(x, y)
效果:按下鼠標中鍵,會有多條根據柏林噪音形成的不斷變化的線。
根據彩虹色進行漸變。
擴展:noise,line函數的擴展。
2. function rainbow_ellipse_0128(x, y)
效果:一個根據柏林噪聲不斷抖動的漸變色球。根據彩虹色變化。
擴展:對noise,ellipse函數的擴展
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; }總結
以上是生活随笔為你收集整理的互动媒体技术A1作业报告的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: muduo网络库:09---多线程服务器
- 下一篇: 多线程服务器的典型适用场合