We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Little code, funky visuals
Page Index Toggle Pages: 1
Little code, funky visuals (Read 970 times)
Little code, funky visuals
Mar 10th, 2008, 12:55am
 
We were just experimenting how far we could come with 50 lines of code and 60 minutes of effort:

http://www.erictoering.nl/visualizers/applet/

to be continued ;)

<code>
import processing.opengl.*;

float q = 1;

void setup(){
 
   size(800, 600,OPENGL);
   noStroke();
   frameRate(10);
   
}

void draw(){
 
 background(0);
 
 fill(100,100,200,100);
 translate(400+cos(q/2)*100,300,260);
 for(int i = 1; i < 50; i++){
   fill(i*5*(cos(mouseY)),q*13+mouseX%255,cos(q)*200,100);
   rotateZ(0.13*q);
   rotateX(sin(q));
   rotateY(cos(sqrt(q))/100);
   translate(10,mouseX/10,mouseY/20);
   beginShape(TRIANGLES);
     vertex(30*sin(q), 75);
     vertex(40, 20);
     vertex(50, 75);
   endShape();
   rotateX(i/100);
   
   rotateY(0.4);
   rotateX(0.7);
   rotateZ(0.3);

   for (int o = 0; o < 5; o++){
     fill(i*13%255,q*2%255,cos(q*2)*200,50);
     ellipse(20-(o/4),50+(o/4),60+o,80+o);
   }
       
   rotateY(-0.4);
   rotateX(-0.7);
   rotateZ(-0.3);

 }

 q=q+0.2%200;
 
}
</code>
Page Index Toggle Pages: 1