Willkommen auf unserem Seminar-Blog

Immer auf dem aktuellen Stand bleiben

Dieser Seminar-Blog befindet sich noch im Aufbau und wird in den kommenden Tagen entsprechend verfeinert.

Member Login

Lost your password?

Registration is closed

Sorry, you are not allowed to register by yourself on this site!

You must either be invited by one of our team member or request an invitation by email at viad.info {at} zhdk {dot} ch.

Satellite Face

20. September 2013

Hier meine Lösung der Aufgabe. Satellite Check it Live Okay, falsch verstanden. Ich habe nun den zweiten Smiley verschachtelt in die erste Matrix-Verschiebung. Nun funktionierts. Der Code dazu: float radian = 0; void setup() { size(400,400); // def. fenstergroesse smooth(); // aktiviere antialiasing strokeWeight(15); // linienbreite } void draw() { background(255); // def. hintergrundfarbe radian += 0.052; // 0.052 = (2Pi)/120 float radius = dist(mouseX,mouseY,width/2,height/2); // rechne die distanz vom mousecursor zum fensterzentrum aus radius = map(radius,0,width,1,4); // rechne aus in welchem bereich der radius am schluss sein sollte radians() pushMatrix(); translate(200,200); rotate(calcAngle()); scale(radius); smiley(); // funtions aufruf pushMatrix(); rotate(radian); translate(100,100); scale(.2); smiley(); // zweiter Smiley popMatrix(); popMatrix(); } // funktion void smiley() { noFill(); ellipse(0,0,180,180); // kopf fill(0); ellipse(0 - 30,0 - 30,20,20); // linkes augen ellipse(0 + 30,0 - 30,20,20); // rechtes augen noFill(); arc(0,0,100,100,radians(20),radians(180-20)); // mund } // berechne den winkel zur fenstermitter vom mausecursor aus // die winkel sind in radiant float calcAngle() { return -atan2(mouseX - (width / 2),mouseY - (height / 2)); }