Diferencia entre revisiones de «Curvas processing 12deabril»

De Casiopea
Sin resumen de edición
Sin resumen de edición
 
Línea 8: Línea 8:
|Profesor=Herbert Spencer,
|Profesor=Herbert Spencer,
|Alumnos=Mauro Herrera,
|Alumnos=Mauro Herrera,
|Imagen=Curvaslocas.JPG
}}
}}
<pre><nowiki> float y, n;  
<pre><nowiki>  
// se consiguen curvas que se mueven con el mouse, se hace un distingo de unas y otras con colores.
 
 
float y, n;  
float m;
float m;



Revisión actual - 21:06 23 may 2012

Mauro Herrera curvas processing 12o4


TítuloMauro Herrera curvas processing 12o4
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 3
Período2012-
Del CursoImagen Escrita 2012,
CarrerasArquitectura
Alumno(s)Mauro Herrera
ProfesorHerbert Spencer
 
// se consiguen curvas que se mueven con el mouse, se hace un distingo de unas y otras con colores.


float y, n; 
float m;

void setup() {
 size(700, 700);
}

void grilla(int divsX, int divsY) {
 stroke(127);  
 float xSpacer = width/(float)divsX;  
 float ySpacer = height/(float)divsY; 
 for (float y = ySpacer; y < height; y +=ySpacer) {
   line(10, y, width, 8+y); 
 }
 for (float x = xSpacer; x < width; x +=xSpacer) {
   line(y, 20, x, height*4); 
 }

}


void cruz(float x, float y, float tam) {

 float t = tam*3; 
 stroke(155,50,30,50);
 line(x+t, y, x-y, y*t);
 stroke (157);
 line(y-x, x-y,y, x);
 

}

void draw() {

 background(255);  
 grilla(50, 50);   

 for (int x = 0; x < height; x++) {

   n = norm(x, 0, height); 
   m = map(mouseX, 20, width, 0, 24);
   y = pow(n, m) * width;  

   cruz(x, y, x);
   cruz(x, x-width, 24);
 }
 println(m); 

}