double dist, dire; point p[] = new point[144]; //string point; point vp; //view point; point ip; //i view point; double hpx[] = new double[144]; //home position x double hpy[] = new double[144]; //home position y double zoom; //zoom double xx, yy; point whp; //width height point; double doai; String st[] = new String[p.length]; String stt = new String("ThisIsMotionExpressLanguage. IfYouWish,YouCanGenerateTheObjectWhichCarriesOutADynamicMotion. Let'sEnjoyDynamicWorld!!!!!URL:motionexpress.net/mel/"); boolean mouseP; //�T���v�� [setup, 300, 300]{ vp = point(monitorWidth / 2, monitorHeight / 2); ip = point(monitorWidth / 2, monitorHeight / 2); zoom = 0.2; xx = monitorWidth * zoom / (Math.sqrt(p.length) + 1); yy = monitorHeight * zoom / (Math.sqrt(p.length) + 1); int ii = 0; for(int i = 0; i < p.length; i++){ p[i] = point(xx, yy); hpx[i] = xx; hpy[i] = yy; xx = xx + monitorWidth * zoom / (Math.sqrt(p.length) + 1); ii += 1; if(Math.sqrt(p.length) <= ii){ yy += monitorHeight * zoom / (Math.sqrt(p.length) + 1); xx = monitorWidth * zoom / (Math.sqrt(p.length) + 1); ii = 0; } } for(int i = 0; i < p.length; i++){ hpx[i] -= (zoom - 1) *(double)monitorWidth/2.; hpy[i] -= (zoom - 1) *(double)monitorHeight/2.; } whp = point(zoom * 10, 0); for(int i = 0; i < p.length; i++){ st[i] = stt.substring(i, i+1); } mouseP = false; setFontName("Helvetica"); } [paint]{ clearAll(); setFontSize(whp.x); setColor(0, 0, 0); for(int i = 0; i < p.length; i++){ drawString(st[i], p[i].x, p[i].y); } } [time, 3]{ zoom = 1.5; reset(); } [time, 6]{ ip.x = 60; ip.y = 60; zoom =1.5; reset(); } [time, 9]{ ip.x = 240; ip.y = 60; zoom =1.5; reset(); } [time, 12]{ ip.x = 60; ip.y = 240; zoom =1.5; reset(); } [time, 15]{ ip.x = 240; ip.y = 240; zoom =1.5; reset(); } [time, 18]{ ip.x = 150; ip.y = 150; zoom = 0.5; reset(); } [always]{ doai = 5; dist = vp.distanceTo(ip); dire = vp.directionTo(ip); vp.push(dist / doai, dire); for(int i = 0; i < p.length; i++){ dist = p[i].distanceTo(hpx[i] - (vp.x - monitorWidth / 2.) * zoom, hpy[i] - (vp.y - monitorHeight / 2.) * zoom); dire = p[i].directionTo(hpx[i] - (vp.x - monitorWidth / 2.) * zoom, hpy[i] -(vp.y - monitorHeight/ 2.) * zoom); p[i].push(dist /doai, dire); } dist = whp.distanceTo(zoom *10, 0); dire = whp.directionTo(zoom * 10, 0); whp.push(dist / doai, dire); if(mouseP == true){ dist = ip.distanceTo(mouseX, mouseY); dire = ip.directionTo(mouseX, mouseY); ip.push(dist, dire); } } void reset(){ xx = monitorWidth * zoom / (Math.sqrt(p.length) + 1); yy = monitorHeight * zoom / (Math.sqrt(p.length) + 1); int ii = 0; for(int i = 0; i < p.length; i++){ hpx[i] = xx; hpy[i] = yy; xx = xx + monitorWidth * zoom / (Math.sqrt(p.length) + 1); ii += 1; if(Math.sqrt(p.length) <= ii){ yy += monitorHeight * zoom / (Math.sqrt(p.length) + 1); xx = monitorWidth * zoom / (Math.sqrt(p.length) + 1); ii = 0; } } for(int i = 0; i < p.length; i++){ hpx[i] -= (zoom - 1) *(double)monitorWidth/2.; hpy[i] -= (zoom - 1) *(double)monitorHeight/2.; } } [mousePressed]{ zoom =1.5; reset(); mouseP = true; } [mouseReleased]{ ip.x = 150; ip.y = 150; zoom = 0.2; reset(); mouseP=false; }