Die erste Übung zum Thema Processing. Ich wollte die Strahlung sehr einfach halten, ohne große Effekte.
void setup(){ size(640,480); background(255); smooth(); } void draw(){ /*Line malen, aber erst die Hälfte berechnen...*/ drawHalfWay(20,30); drawHalfWay(200,100); drawHalfWay(60,200); drawHalfWay(160,120); } void drawHalfWay(int theX, int theY){ int myHalfX = getAverage(mouseX, theX); int myHalfY = getAverage(mouseY, theY); line(theX, theY, myHalfX, myHalfY); } int getAverage(int theA, int theB){ int myHalfWay = ((theA + theB) / 2); return myHalfWay; }