FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Topics & Contributions
   Automated Systems
(Moderator: REAS)
   Pyramid - Sierpinski
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Pyramid - Sierpinski  (Read 1339 times)
Dimitre

WWW
Pyramid - Sierpinski
« on: May 6th, 2003, 5:02am »

Some experience with the ^ operator
http://dmtr.org/generative/?id=43
Code:
// Pyramid - Sierpinski
// by Dimitre Lima
// moving the mouse changes the system rotation
// shortcut keys: "+" & "-" distance between points
// "<" & ">" dimensions of object
// have fun
 
int width=400; int height=400;
int dimensao = 32;
int fator=3;
float rotx, roty;
 
void setup() {
  size(width,height);
  background(0);
}
 
void mouseMoved() {
   rotx = 2*PI*mouseY/width;
   roty  = 2*PI*mouseX/width;
}
 
void loop()
{
  if(keyPressed) {
    if (key == '+') fator ++;
    if (key == '-') fator --;
    if (fator< 1) fator=1;
     
    if (key == '>') dimensao ++;
    if (key == '<') dimensao --;
  }
   
  translate (width/2, height/2);
  rotateX (rotx);
  rotateZ (roty);
  stroke (255);
   
  for (int i=-dimensao; i<dimensao; i++)
  for (int j=-dimensao; j<dimensao; j++)
  {
    push();
 translate (i*fator, j*fator, i*fator^j*fator);  
 point (0,0);
    pop();
  }
}
 
Dara

WWW Email
Re: Pyramid - Sierpinski
« Reply #1 on: May 6th, 2003, 9:45am »

nice stuff on dmtr.org. may i suggest you to add an audio on/off switch for the "sonar" piece. i love listening to signals but i had to restart my machine! because sound never stops. could you also make its code public?  
 
 
vent

WWW
Re: Pyramid - Sierpinski
« Reply #2 on: May 6th, 2003, 3:44pm »

Great work on dmtr.org -- java blur z is wonderful.
 

http://www.shapevent.com/
Dimitre

WWW
Re: Pyramid - Sierpinski
« Reply #3 on: May 6th, 2003, 5:46pm »

thanks!
Dara, I removed sonar experiment from there, because I dont really know how to stop sounds on browser closing
I made it in java, and I used a library called sun.audio. I think in proce55ing there will be much easier and better audio capabilities than mess with that library.
 
Pages: 1 

« Previous topic | Next topic »