-
-
Save anonymous/7494ff5d09ba8fa917bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //ejemplos de ciclo for | |
| int ancho=800, alto=600; | |
| void setup(){ | |
| size(ancho,alto,P3D); //para activar rotateZ, activar P3D | |
| } | |
| void draw(){ | |
| background(255); | |
| noFill(); | |
| ellipseMode(CORNER); | |
| for(int i=0;i<=width;i=i+5){ //for(inicio; condicion; variacion) | |
| strokeWeight(1); | |
| line(i,0,i,height); | |
| } | |
| for(int j=50;j<=width-100;j=j+50){ | |
| for(int k=50;k<=height-100;k=k+50){ | |
| strokeWeight(2); | |
| ellipse(j,k,45,45); | |
| } | |
| } | |
| } | |
| /* | |
| void draw(){ | |
| background(255); | |
| translate(width/2,height/2); | |
| rotateY(radians(frameCount)); | |
| pushMatrix(); | |
| rotate(radians(frameCount)); | |
| rotate(-radians(frameCount)); | |
| for(int j=0;j<=width;j=j+4){ | |
| line(0,j,width,j); | |
| } | |
| popMatrix(); | |
| pushMatrix(); | |
| rotate(-radians(frameCount)); | |
| for(int i=0;i<=width;i=i+6){ | |
| line(i,0,i,height); | |
| } | |
| popMatrix(); | |
| } | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment