Processing Advent Calendaråå è¨äºã§ã
ã¯ããã«
ãä»å¹´ãProcessing Advent Calendarãªãä¼ç»ã«åå ããã¦ããã ãã¾ããã®ã§ãä¹ ãã¶ãã®Processingã®è¨äºã§ããProcessingã¨ããã°ãã¡ãã£ã¨ãããåç»ãä½ãã®ã«ããã¿ãªã¨ãããã¨ã§ãçµå©å¼ã®ã¹ã©ã¤ãã·ã§ã¼ã®ä½ãæ¹ãé¡æã¨ãã¦åãä¸ãã¦ã¿ããã¨æãã¾ããã¿ã¤ãã«ã«ç¶ã¨æ¸ãã¦ãã£ãã®ã§æ°ã¥ããæ¹ãããããããã¾ãããããã®çµå©å¼ã®åç»ãä½ãã·ãªã¼ãºã¯2åç®ã§ãã1回目は実に半年以上前というねããããªããã§ãä»åã¯2åç®ã«ãã¦å¤åæçµåã§ããå®ç®ãã¦è¦ãï¼ï¼
ãã¨ããããã§ãä»åã¯åçãå³ããå·¦ã«ãã¥ã³ãã¥ã³æµãã¦è¡ãã¹ã©ã¤ãã·ã§ã¼ãä½ãããã¨æãã¾ããã¡ãã£ã¨ã ã3Dçè¦ç´ ãå
¥ãã¦ãåçã«å¥¥è¡ããåºãããé ãã®åçã¯ã¼ãããããããã«ãã¦ãã¾ããè¨èã®èª¬æã ã¨ã¤ã¡ã¼ã¸ãã§ããªãæ¹ã¯ãå¾ã§åç»åºã¦ãã¾ãã®ã§ãå¿é
ãªããããã¨ãããµããæ¼åºã§ãããæå¤ã«iMovieã¨ãã§ã¯ã§ããªãã£ãããã¾ãã
ãå®ã¯ãMotionã£ã¦ã½ããã§ãã®æ¼åºä½ã£ã¦ãã人ããã¦ãèªåã®çµå©å¼ã®åç»ã§çä¼¼ãããã¨æãMotionè²·ã£ãã®ã§ããèªåã«ã¯ä½¿ãããªããã¨ãã§ããæ³£ãæ³£ãProcessingã§ããã°ã©ãã³ã°ããã¨ããæ²ããæãåºãããã¾ãMotion使ãããªããªãèªåã®ãããªäººã«ãProcessingã¯å¼·ãå³æ¹ã§ãã
ã½ãã使ãæ¹
ãæ¬è¨äºæå¾ã«è¼ãã¦ããã½ã¼ã¹ã³ã¼ããã³ãããã¦é©å½ãªãã©ã«ãã«ä¿åãã¦ããã¾ããããåããã©ã«ãã«"data"ã¨ãããã©ã«ããä½ã£ã¦ãã®å¾ã«èªåã使ãããåçãtex0.jpgãtex23.jpgã¨ããååã«ãªãã¼ã ãã¦ããã¾ãã
ããã¨ã¯å®è¡ããã ãï¼æ åãæµãã¦è¡ãã¨åæã«ããã°ã©ã ããããã©ã«ãã« framesã¨ãããã©ã«ããä½æãããã®ä¸ã« 0000.tif, 0001.tifâ¦ã¨ãã£ãæãã«1ãã¬ã¼ã æ¯ã«ç»åã鬼ã®ããã«ä½ããã¦è¡ãã¾ããããæãã®ã¨ããã§ESCãã¿ã³ãæ¼ãã¦ããã°çµäºã§ãã
ãvoid X_Scroll_Setup()é¢æ°ã®ãã©ã¡ã¼ã¿ãå¼ãã¨ãåçã®ä½ç½®ãå¤ããã¾ãã®ã§æ°ã«å
¥ããªãæ¹ã¯é©å½ã«å¼ã£ã¦ã¿ã¦ä¸ããã
åç»çæ
ãProcessing2ã§ã®åç»ã®çææ¹æ³ã¯Processing1ã¨ã¯ç°ãªãã®ã§è¦æ³¨æã§ããã¨ãã£ã¦ãç°¡åã§ã以ä¸ã®3ã¹ãããã§ã§ãã¾ãã
- Processing2ãç«ã¡ä¸ãã
- Processing2ã®ã¡ãã¥ããTools -> Movie Maker ãé¸æãã¦Movie Makerãç«ã¡ä¸ãã
- å³å´ã®Chooseãã¿ã³ãæ¼ãã¦ãå ã»ã©é¬¼ã®ããã«ç»åãã¡ã¤ã«ãä½æãã frames ãã©ã«ããé¸æãã
- ãµã¤ãºãå ¥åããï¼ããã°ã©ã ã®size_xã¨size_yã«åããããããä»åã¯960 x 540ã ãï¼ãå ¥åã§ããªãå ´åã¯ãsame size as originalsã®ãã§ãã¯ããã¯ã¹ãå¤ãã¾ããã
- Create Movieãã¿ã³ãæ¼ãã¦åç»ä½æ
â»2014/12/15追è¨
ãä¹
ãã¶ãã«åããã¨ãããã¨ãããããã¤ã®éã«ãMovie Makerãèªåã®ç°å¢ã§ã¯ä½¿ããªããªã£ã¦ãã¾ããã®ã§ä»ã®æ¹æ³ã§åç»çæãã¾ãããèªåã¨åããããªä¸å¹¸ãªäººã¯ä¸è¨è¨äºåç
§ä¸ããã
å®æããåç»
ãå®æããåç»ããã¡ãã§ããä»åã¯ãæç¥ç岡å´å¸ãèªããããã£ã©ããªã«ã¶ããããé¡æã«ä½ã£ã¦ã¿ã¾ãããåçã¯å ¨é¨èªåãæ®å½±ãããã®ã§ãã
ãåçã®ææ°ãä½ç½®å¤æ´çç°¡åã«ã§ãã¾ãã®ã§è©¦ãã¦ã¿ã¦ä¸ããã
èæ¯ãå¯ããã¨æã£ãã¨ãã¯ãããã¯ã°ã©ã¦ã³ãã®è²ãç½ããç·ãéã«å¤æ´ãã¦ãiMovieã®ã¯ãããã¼åææ©è½ã§å¥½ããªåç»ã¨åæããã¨ãã£ãé«çãã¯ããã¯ã使ãã®ãããããããã¾ãããâ
ããã°ã©ã
ãä»åã¯èªåã«ã¯çããProcessing2.0対å¿ã§æ¸ãã¾ãããã§ã¯æ©éã½ã¼ã¹ã³ã¼ããã
解説ã¯â¦ç¹ã«ç¡ãã§ãï¼ã¾ããããªç°¡åãªããã°ã©ã ã§çµæ§è¯ãæãã®åç»ãã§ãããã¨ãããã¨ã§ãã
int size_x = 1920/2; int size_y = 1080/2; int rotX = -2000; int x_move = 5; float x_far = 5000; float x_step = 2000; int camera_z = 1500; FlyScreen[] FlyScreens = new FlyScreen[24]; class FlyScreen{ PImage img; String name; float x, y, z; FlyScreen(String name, float x, float y, float z){ this.name = name; this.x = x; this.y = y; this.z = z; this.img = loadImage(name); int tmp_blur = (int)((camera_z*0.7 - z)/450); if(tmp_blur > 0){ this.img.filter(BLUR, tmp_blur); } } void DrawImage(){ image(this.img, this.x, this.y); } } void setup(){ size(size_x, size_y, P3D); colorMode(RGB, 255); Init(); imageMode(CENTER); } void Init(){ float x, y, z; X_Scroll_Setup(); background(255,255,255); } void X_Scroll_Setup(){ FlyScreens[0] = new FlyScreen("tex0.jpg", x_far-2.4*x_step, float(height/2)-100, 200); FlyScreens[1] = new FlyScreen("tex1.jpg", x_far-2.2*x_step, float(height/2)+200, 400); FlyScreens[2] = new FlyScreen("tex2.jpg", x_far-2.1*x_step, float(height/2)-300, 210); FlyScreens[3] = new FlyScreen("tex3.jpg", x_far-1.9*x_step, float(height/2)+130, 400); FlyScreens[4] = new FlyScreen("tex4.jpg", x_far-1.7*x_step, float(height/2)-200, 320); FlyScreens[5] = new FlyScreen("tex5.jpg", x_far-1.5*x_step, float(height/2)+150, 250); FlyScreens[6] = new FlyScreen("tex6.jpg", x_far-1.35*x_step, float(height/2)-300, 330); FlyScreens[7] = new FlyScreen("tex7.jpg", x_far-1.1*x_step, float(height/2)-50, 250); FlyScreens[8] = new FlyScreen("tex8.jpg", x_far-0.8*x_step, float(height/2)+25, 300); FlyScreens[9] = new FlyScreen("tex9.jpg", x_far-0.6*x_step, float(height/2)-150, 250); FlyScreens[10] = new FlyScreen("tex10.jpg", x_far-0.5*x_step, float(height/2)+300, 340); FlyScreens[11] = new FlyScreen("tex11.jpg", x_far-0.3*x_step, float(height/2)-100, 400); FlyScreens[12] = new FlyScreen("tex12.jpg", x_far-2.31*x_step, float(height/2)+200, -150); FlyScreens[13] = new FlyScreen("tex13.jpg", x_far-2.42*x_step, float(height/2)-500, -50); FlyScreens[14] = new FlyScreen("tex14.jpg", x_far-1.95*x_step, float(height/2)+300, -200); FlyScreens[15] = new FlyScreen("tex15.jpg", x_far-1.82*x_step, float(height/2)-500, -100); FlyScreens[16] = new FlyScreen("tex16.jpg", x_far-1.75*x_step, float(height/2)+350, -100); FlyScreens[17] = new FlyScreen("tex17.jpg", x_far-1.45*x_step, float(height/2)-200, 0); FlyScreens[18] = new FlyScreen("tex18.jpg", x_far-1.35*x_step, float(height/2)+350, -20); FlyScreens[19] = new FlyScreen("tex19.jpg", x_far-1.24*x_step, float(height/2)+25, -250); FlyScreens[20] = new FlyScreen("tex20.jpg", x_far-1.1*x_step, float(height/2)+550, -350); FlyScreens[21] = new FlyScreen("tex21.jpg", x_far-0.92*x_step, float(height/2)+350, -600); FlyScreens[22] = new FlyScreen("tex22.jpg", x_far-0.83*x_step, float(height/2)-300, -200); FlyScreens[23] = new FlyScreen("tex23.jpg", x_far-0.7*x_step, float(height/2)+160, -150); } void X_Scroll(){ camera(width/2+rotX, height/2, camera_z, width/2+rotX, height/2, 0, 0, 1, 0); rotX += x_move; for(int i = 0; i < FlyScreens.length; i++){ pushMatrix(); translate(FlyScreens[i].x, 0, FlyScreens[i].z); FlyScreens[i].DrawImage(); popMatrix(); } } void draw(){ lights(); background(255,255,255); X_Scroll(); saveFrame("frames/####.tif"); }