ã¯ããã«
ã以åãå®çã¬ã³ãºãä½ã£ã次ã®æ¥ã«ç¡æã®å®çã¬ã³ãºiPhoneã¢ããªãåºããããããããããã¦Processingã§å®çã¬ã³ãºã½ããä½ã£ã¦ãå¾æã¯ãã¦ããªãã®ã§å ¬éãã¾ããããã®ã¨ããä»å¾ã®ã¨ããã«
æ°ãåãããããã¡ãã£ã¨æ¹è¯ãã¾ããå¾ã¯ãå¤å1æéãããé å¼µãã°åç»ã®å®çã¬ã³ãºé¢¨ã¨ãã§ã¯ããã§ããããã«ãªãã¯ããªã®ã§æ°ãåãããä½ãã¾ããã§ãå¤åæ°ã¯åããªãã¨æãã¾ããä¸ä¸æ¬²ãã人ãããããªã¯ã¨ã¹ããã¦ä¸ããã
ãã¨æ¸ãã¦ããã®ã§ãããé©ãäºã«ç±ããªã¯ã¨ã¹ããå¤æ°ãã£ãã®ã§åç»ã½ãããå ¬éãã¾ããã
ã1件ã ãã ãï¼ã§ããç§ã¯ç´æãç ´ããªããã¨ã§å®è©ã®ãã社ä¼äººãªã®ã§ã¡ããã¨ç´æã¯ã¾ããã¾ãããã¨ããããã§å ¬éãã¾ããã°ã¼ã°ã«ã§å®çã¬ã³ãºã®åç»ãä½ãã½ãããé©å½ã«æ¤ç´¢ããæãåºã¦ããªãã£ãã®ã§ãåæã«ä¸çåãåä¹ãã¾ãã誰ãã«ææãããã¾ã§åªè¶æã«æµ¸ãããã¨æãã¾ãããããiPhoneã§ãå®çã¬ã³ãºåç»ã½ããã§ãããªã¨æã£ã¦ãã¾ããããã®ã¨ãã¯ãç§ã®æ¹ãå ã ï¼ãã¨åªè¶æãã£ã·ãã«è¦ä¸ãã¦ããããã¨æãã¾ãâ
ææç©
ãã¨ããããã§ã社ä¼äººãããææããå ±åãã¾ããç§ã¯ä¼ç¤¾ã®ã¤ãã ã¯ã³â
ãã©ãï¼åç»ã«ããã¨çµæ§ããæããããªãã§ãããï¼ã¡ãã£ã¨å®çã®ä½ç½®ããºã¬ãªãã®ãããã£ã½ãã§ãããã©ããªã¬ã³ãºã§æ®ã£ãåçãå®çã¬ã³ãºé¢¨ã«ã§ããã®ãããç¹ã§ããã
ãã¡ãªã¿ã«åç»ã¯ã«ã¡ã©OLYMPUS OM-D E-M5ãã¬ã³ãºMZD 45mm f1.8ã®çµã¿åããã§è»ã«ç½®ãã¦æ®å½±ãããã®ã§ããBGMã¯ãé©å½ãªããªã¼ç´ æãè¦ã¤ãããªãã£ãã®ã§ãä»æ¹ãªãiPadã§Garagebandã¨Korg iKaossilatorã®çµã¿åããã§iPadã ãã§ã¤ããã¾ãããã¡ãªã¿ã«ãBGMä½ãéã«ãiPad+Garageband+Korg iKaossilatorã®çµã¿åããã§èª°ã§ãæ©æ¢°çã«ç¡éã«ä½æ²åºæ¥ãæ¹æ³ãç·¨ã¿åºãã¦ãã¾ã£ãã®ã§èå³ãã人ãããããããå
¬éãã¾ãã社ä¼äººãªã®ã§åã¤ãã¾ããã
ã½ã¼ã¹ã³ã¼ãã¨ä½¿ãæ¹
ãã½ã¼ã¹ã³ã¼ãã§ãããã¤ãã®éãProcessingã¨ããããã°ã©ãã³ã°è¨èªã使ã£ã¦ãã¾ããProcessingãã¦ã³ãã¼ããã¦(2.xxç³»ã§ãªã1.xxç³»ã®ãã¼ã¸ã§ã³ä½¿ã£ã¦ä¸ããï¼ã½ã¼ã¹ã³ãããã¦RUNæ¼ãã°Winã§ãMacã§ãåãã¨æãã¾ãã
ãç¹ã«ããã°ã©ã ã®èª¬æã¯ãªãã®ã§é©å½ã«èªã¿è§£ãã¦ä¸ãããååã®å®çã¬ã³ãºã½ãããã¡ãã¡ããã¨å¼ã£ã¦åç»ã«ããã ãã§ããæ£æ¹å½¢ã§ã横é·ã®åç»ã§ã大ä¸å¤«ã§ãã縦é·ã¯ãã¡ãªã®ã§å¿
è¦ãªäººã¯é©å½ã«å¼ã£ã¦ä¸ããããã¨ãã¡ãã£ã¨å®çã£ã½ãè¦ããããã«å¾®å¦ã«æ¹è¯ãã¦ãã¾ãã
ã使ãæ¹ã¯ãRUNæ¼ããããã¤ã¢ãã°ç»é¢ãåºãã®ã§ããã¡ã¤ã«ãé¸æããã¨åç»ã®æåããèªåçã«å¤æéå§ãã¾ãããããªããã§ããããªã¨æã£ãã¨ããã§ã¹ãã¼ã¹ãã¼ãæ¼ãããã"soratama.mov"ã¨ããå®çã¬ã³ãºé¢¨åç»ä¸ä¸ä¸ããã¨ãã親åè¨è¨ã§ãã
ãã¡ãªã¿ã«7åã®åç»ã®å¤æã«ä¸¸ä¸æ¥ä»¥ä¸ãããæ¿é ã½ããã§ããå¤åé å¼µãã°é«éåã§ããã®ã§ãããç¹ã«ããæ°ã¯ãªãã®ã§ããé«éåã§ãããæãã¦ä¸ãããè¶ æ°ãé·ã人åãã½ããâ
import hypermedia.video.*; import processing.video.*; PImage tex; PImage img_blur; int fps = 30; OpenCV opencv; MovieMaker mm; final float pic_x = 1920; final float pic_y = 1080; final float camera_z = 16; final float sphere_size = 3; // from 0 to camera_z/2 final int backimg_blur_level = 4; final float soratama_blur_level = 1; final float backimg_size = 0.0; // from 0 to 0.5 final float soratama_size = 0.6; // from 0 to 1 final float step_ang = 180/3; final float step_rad = 100; void setup() { size((int)pic_x, (int)pic_y, P3D); println("select movie."); String moviePath = selectInput(); opencv = new OpenCV( this ); opencv.movie(moviePath, (int)pic_x, (int)pic_y); textureMode(NORMALIZED); mm = new MovieMaker(this, (int)pic_x, (int)pic_y, "soratama.mov", fps, MovieMaker.VIDEO, MovieMaker.LOSSLESS); frameRate(fps); } PImage rectimage(PImage img){ PImage img_rect; if(img.width > img.height){ img_rect = img.get((img.width-img.height)/2, 0, img.height, img.height); }else{ img_rect = img.get(0, (img.height-img.width)/2, img.width, img.width); } return img_rect; } void draw() { opencv.read(); img_blur = opencv.image(); img_blur.filter(BLUR, backimg_blur_level); tex = opencv.image(); tex = rectimage(tex); tex.filter(BLUR, soratama_blur_level); // Camera Setting camera(0, 0, camera_z, 0, 0, 0, 0, 1, 0); // draw blur image background float frame_x = pic_x / (camera_z*2); float frame_y = pic_y / (camera_z*2); noStroke(); beginShape(); texture(img_blur); vertex(-frame_x, -frame_y, 0, backimg_size, backimg_size); vertex(frame_x, -frame_y, 0, 1-backimg_size, backimg_size); vertex(frame_x, frame_y, 0, 1-backimg_size, 1-backimg_size); vertex(-frame_x, frame_y, 0, backimg_size, 1-backimg_size); endShape(); // draw soratama final float rad_sphere = camera_z/2 - sphere_size; final float step_sphere = TWO_PI / step_ang; final float step_sphere2 = rad_sphere / step_rad; noStroke(); beginShape(); texture(tex); for(float x = 0; x < rad_sphere; x += step_sphere2){ for(float ang = 0; ang < TWO_PI; ang += step_sphere){ vertex(x*cos(ang), x*sin(ang), sqrt(rad_sphere*rad_sphere - x*x), soratama_size*(-x*x/(rad_sphere*rad_sphere)*cos(ang))+0.5, soratama_size*(-x*x/(rad_sphere*rad_sphere)*sin(ang)) + 0.5); } } endShape(); mm.addFrame(); } void keyPressed() { if (key == ' ') { mm.finish(); println("save movie."); exit(); } }
ã¾ã¨ãã¨ä»å¾
ãå®çãå¢ãããããé«éåãããã¨ãè²ã æ¹è¯ã®ä½å°ã¯ãããã©ãã¨ããããæºè¶³ããã®ã§ããã¯ãã®è¾ºã§ãã£ããéãããããªã¨ãã¾ããè²ã å¤ãªåç»ä½ããããªã¨æã£ã¦ãã¾ããã¨ãããã3ã¤ãããæ¡ã¯ãããã©ãä½ããã¤é ãããã¯æªå®ã§ãããªã¯ã¨ã¹ãããã°èæ ®ã¯ãã¾ãï¼ç´æã¯ã§ããªãã§ãï¼ã®ã§ã©ãã©ãä¸ãããã§ãã§ãã¼â
é¢é£è¨äº
ã宙玉レンズを作った次の日に無料の宙玉レンズiPhoneアプリが出たからむしゃくしゃしてProcessingで宙玉レンズソフト作った後悔はしていないので公開するã
ã宙玉レンズ作ったというか買いましたã