Identidad Circular
De Casiopea
Título | Sol de luna |
---|---|
Asignatura | Imagen Escrita 2017 |
Del Curso | Imagen Escrita 2017 |
Carreras | Arquitectura |
Alumno(s) | Nicolas Farias |
<processingjs>
float inc;
int sides = 2048;
int nPoints = 500;
void setup(){
size(800, 800); inc = TWO_PI / float(sides); fill(#FA7900); smooth(); noStroke();
}
void draw(){
float a = 0; background(#249AFF); dibujarCurva(width/2,height/2);
}
void dibujarCurva(float px, float py){
pushMatrix(); translate(px,py); float a = 60.0; float b = (1.26 + 0.26*sin(millis()/1000.0)) * a;
beginShape(); for (int i=0; i<nPoints; i++){ float t = TWO_PI*(float)i/nPoints; float r = sqrt((a*a) * (cos(800*t) + sqrt(pow(b/a,16.0)- sq(sin(800*t))))); float x = r*cos(t); float y = r*sin(t); vertex(x, y); } endShape(CLOSE); popMatrix();
}
<nowiki> void setup() { size(600, 600); background(255); stroke (40, 80); } void draw(){ if (keyPressed){ if (key == 's'){ saveFrame("imagensecuenciaFMA.jpg"); } if (key == ' '){ background(255); } } noFill(); // cuadrado strokeWeight(4); // grosor de línea rectMode(CENTER); translate(width/2,height/2); rotate(PI+mouseX); rect(0,0,width-300,height-300); } <processingjs>