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_
   Discussion
   General Processing Discussion
(Moderators: fry, REAS)
   Processing tennis
« Previous topic | Next topic »

Pages: 1 2 3 4 
   Author  Topic: Processing tennis  (Read 2105 times)
Koenie

170825270170825270koeniedesign WWW Email
Re: Processing tennis
« Reply #15 on: Aug 26th, 2003, 4:05pm »

Sure thing! It's really simple, using only 1 variable, and here it is:
 
Code:
// Processing tennis
// round 1 by Koenie
 
float angle = 0;
 
void setup() {
  size(200, 200);
  background(0, 200, 255);
  stroke(100);
  fill(255);
  ellipseMode(CENTER_DIAMETER);
}
 
void loop() {
  ellipse(width/2, height/2, 50, 50);
   
  if (angle > TWO_PI) angle = 0;
  ellipse(50*cos(angle)+width/2, 50*sin(angle)+height/2, 50, 50);
  angle += 0.02;
}

 
Koenie
 

http://koeniedesign.com
Martin

122417302122417302martingomez_listsmg1ph WWW Email
Re: Processing tennis
« Reply #16 on: Aug 26th, 2003, 4:24pm »

Code:

// Processing tennis
// round 1.0001 by Martin
 
float angle = 0;
 
void setup() {
  size(200, 200);
  background(0, 200, 255);
  stroke(100);
  fill(255);
  smooth();
  ellipseMode(CENTER_DIAMETER);
}
 
void loop() {
  push();
  translate(width/2,height/12,-25);
  rotateY( angle );
  ellipse(width/2, height/2, 50, 50);
 
  if (angle > TWO_PI) angle = 0;
  ellipse(50*cos(angle)+width/2, 50*sin(angle)+height/2, 50, 50);
  ellipse(50*sin(angle)+width/2, 50*cos(angle)+height/2, 25, 25);
  ellipse(75*cos(angle)+width/2, 75*cos(angle)+height/2, 25, 25);
  angle += 0.02;
 
  pop();
}
 
mKoser

WWW Email
Re: Processing tennis
« Reply #17 on: Aug 26th, 2003, 4:42pm »

Code:

// processing tennis
// Koenie
// mKoser
// who's next?
 
float angle = 0f;
 
void setup(){
  size(200, 200);
  background(0, 200, 255);
  fill(255);
  noStroke();
  //smooth();
  lights();
}
 
void loop(){
  translate(width/2, height/2);
  // mother sphere
  sphere(50);
 
  // orbitting sphere
  if (angle > TWO_PI) angle = 0;
  push();
  translate(50*cos(angle), 0, 50*sin(angle));
  sphere(30);
  pop();
  angle += 0.02;
}
 

mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
scrap-pile

WWW
Re: Processing tennis
« Reply #18 on: Aug 26th, 2003, 6:12pm »

Code:

 
// Processing tennis
// Koenie
// Martin
// mKoser
// scrap-pile
 
float angle = 0;
 
void setup() {
  size(200, 200);
  colorMode(HSB,100);
  background(30, 100, 70);
  noStroke();
}
 
void loop() {
  push();
  translate(width/2,height/2,-150);
  rotateY( angle );
  rotateX( angle );
     
  push();
  translate(40*cos(angle)+width/-5, 40*sin(angle)+height/-5);
  fill(18, 100, 100);
  sphere(60);
  pop();
 
  if (angle > TWO_PI) angle = 0;
   
  push();
  translate(40*cos(angle)+width/5, 40*sin(angle)+height/5);
  fill(17, 100, 95);
  sphere(40);
  pop();
   
  push();
  translate(25*cos(angle)+width/3, 25*sin(angle)+height/-3);
  fill(16, 100, 95);
  sphere(25);
  pop();
   
  rotateX(angle);
   
  push();
  translate(20*cos(angle)+width/-2, 20*sin(angle)+height/2);
  fill(15, 100, 95);
  sphere(20);
  pop();
   
  angle += .07;
 
  pop();
}
 
 
arielm

WWW
Re: Processing tennis
« Reply #19 on: Aug 26th, 2003, 11:18pm »

Code:

// Processing tennis, round one
// Koenie
// Martin
// mKoser
// scrap-pile
// arielm
 
float angle;  
 
void setup() {  
  size(200, 200);  
  background(0, 200, 255);  
  framerate(25);
  noStroke();  
  fill(255);  
  ellipseMode(CENTER_DIAMETER);  
}
 
void loop()
{
  translate(100, 100);
  rotateZ(angle);
  ellipse(0.0, 50.0 * abs(cos(angle)), 10.0, 10.0);
 
  angle += radians(9.0);
}
« Last Edit: Aug 26th, 2003, 11:20pm by arielm »  

Ariel Malka | www.chronotext.org
benelek

35160983516098 WWW Email
Re: Processing tennis
« Reply #20 on: Aug 27th, 2003, 7:55am »

"[re]code"?
Code:

// Processing tennis, round one  
// Koenie  
// Martin  
// mKoser  
// scrap-pile  
// arielm  
// benelek
 
float angle = 0;  
 
void setup() {  
  size(200, 200);  
  background(0, 200, 255);  
  ellipseMode(CENTER_DIAMETER);  
}  
 
void loop() {
  noBackground();
  if (angle > TWO_PI) angle = 0;
  fill(200,0,0);  
  stroke(255);  
  ellipse(width*0.8*angle/TWO_PI, 50*sin(angle)+height/2, 10, 10);  
  fill(0,200,0);
  ellipse(width*0.8*angle/TWO_PI + 10*cos(angle), 50*sin(angle)+height/2 + 30*sin(angle), 8, 8);  
  fill(0,0,200);
  ellipse(width*0.8*angle/TWO_PI + 10*cos(angle) + 30*cos(2*angle), 50*sin(angle)+height/2 + 30*sin(angle), 5, 5);  
  angle += 0.02;  
}
 
toxi

WWW
Re: Processing tennis
« Reply #21 on: Aug 27th, 2003, 1:20pm »

sorry to jump in here, i hope there wasn't a queue, but i really just stumbled across this thread and the idea kicks ass...
 
so here's my reshuffled twisted version...
 
Code:
// Processing tennis, round one  
// Koenie  
// Martin  
// mKoser  
// scrap-pile  
// arielm  
// benelek
// toxi
 
float angle = 0;  
 
void setup() {  
  size(200, 200);  
  background(0,200,255);  
  ellipseMode(CENTER_DIAMETER);  
}  
 
void loop() {
  noBackground();
  fill(200,0,0,128);  
  stroke(255);
  angle=(float)((millis()*32)%62832)*0.0001;
  ellipse(width*0.8*angle/TWO_PI, (millis()%100)*sin(angle)+height/2, mouseX>>2, mouseY>>2);  
  fill(0,200,0,160);
  ellipse(width*0.8*angle/TWO_PI + (millis()%80)*cos(angle), 50*sin(angle)+height/2 - 80*sin(angle), mouseX>>3, mouseY>>3);  
  fill(0,0,200,192);
  ellipse(width*0.8*angle/TWO_PI + 10*cos(angle) + 30*cos(2*angle), (millis()%50)*sin(angle)+height/2 + 60*sin(angle), mouseX>>3, mouseY>>3);
  for(angle=0; angle<width*height-1; angle++) {
    pixels[(int)angle]= ((pixels[(int)angle]>>16&0xff)+(pixels[(int)angle+1]>>16&0xff))<<15&0xff0000 |
    ((pixels[(int)angle]>>8&0xff)+(pixels[(int)angle+1]>>8&0xff))<<7&0xff00 |
    ((pixels[(int)angle]&0xff)+(pixels[(int)angle+1]&0xff))>>1;
  }
}

 
i extensively used the millis() function to free up the angle variable for some additional filtering.
 

http://toxi.co.uk/
Jerronimo

WWW
Re: Processing tennis
« Reply #22 on: Aug 28th, 2003, 4:11pm »

This is an awesome idea.  I'm working on a Processing Tennis website right now, to facilitate this in the future.
 
 
53

i_253 WWW Email
Re: Processing tennis
« Reply #23 on: Aug 28th, 2003, 5:26pm »

sorry, sticking more to the original or cutting the line...
 
on Aug 26th, 2003, 6:12pm, scrap-pile wrote:
Code:

 
// Processing tennis
// Koenie
// Martin
// mKoser
// scrap-pile
// 53
 
float angle = 0;
 
void setup() {
  size(200, 200);
  colorMode(HSB,100);
  background(30, 100, 70);
  noStroke();
  smooth();
}
 
void loop() {
  push();
  translate(width/2,height/2,-150);
  rotateY( angle );
  rotateX( angle );
    
  push();
  translate(40*cos(angle)+width/-5, 40*sin(angle)+height/-5);
  fill(18, 100, 100);
  sphere(60);
  pop();
 
  if (angle > TWO_PI) angle = 0;
  
  push();
  translate(40*cos(angle)+width/5, 40*sin(angle)+height/5);
  fill(17, 100, 95);
  sphere(40);
  pop();
  
  push();
  translate(25*cos(angle)+width/3, 25*sin(angle)+height/-3);
  fill(16, 100, 95);
  sphere(25);
  pop();
  
  rotateX(angle);
  
  push();
  translate(20*cos(angle)+width/-2, 20*sin(angle)+height/2);
  fill(15, 100, 95);
  sphere(20);
  pop();
  
  angle += .07;
 
  pop();
 
  /*** flying boxes ***/
  fill(random(126));  
  if (angle <= HALF_PI){
    push();
    translate(width/2+30, height/2-30, 200*cos(2* (PI- angle))-width/5);    
    box(10);  
    pop();  
  }
   
  if (angle > HALF_PI && angle <= (HALF_PI+PI)){
    push();    
    translate(width/2-30, height/2+30, 200*cos(2* (angle))-width/6);  
    box(10);  
    pop();  
  }
   
  push();    
  if (angle <= PI){
    translate(width/2-30, height/2-30, 200*cos(PI- angle)-width/3);  
    box(15);  
  } else {
    translate(width/2+30, height/2+30, 200*cos(angle)-width/3);  
    box(15);
  }  
  pop();  
}
 

 
Koenie

170825270170825270koeniedesign WWW Email
Re: Processing tennis
« Reply #24 on: Aug 28th, 2003, 5:37pm »

on Aug 28th, 2003, 4:11pm, Jerronimo wrote:
This is an awesome idea.  I'm working on a Processing Tennis website right now, to facilitate this in the future.
 

 
What exactly are you making I would like to know why you think it needs a special website. Is this forum board not good enough
 
Koenie
 

http://koeniedesign.com
Jerronimo

WWW
Re: Processing tennis
« Reply #25 on: Aug 28th, 2003, 6:57pm »

I was going to model it after the p'shop tennis websites in which people can choose to start matches with other people, challenge others, etc.  I would also have facilities to store and let browsing people run the applets.    
 
ie; you can upload your  .pde files, and if you want, you can also upload the .jar files, then the site would automatically wrap it all with pages.
 
I figure we could also have the facilities there to allow software artisans to showcase their work.  it'd be a sort of portfolio of your Processing sketches.  (And of course, everything would be free... i would never charge for the hosting of the programs.)
 
In essence; it would be an automated repository for Processing sketches, with the facilities for P5 tennis challenges and/or competitions and such.
 
It wouldn't be too hard to make... just a bunch of PHP scripts, really...
 
 
Incidentally, when I copy and paste to my mac, i have to manually go in and replace all spaces with tabs, otherwise i get lots of non-found references, and it doesn't build... anyone else have this problem?
 
vent

WWW
Re: Processing tennis
« Reply #26 on: Aug 28th, 2003, 7:05pm »

This is fun.
 
// Processing tennis, round one
// Koenie
// Martin
// mKoser
// scrap-pile
// 53  
// arielm
// benelek
// toxi
// zevan
 
float angle = 0;
 
void setup() {
  size(400, 400);
  noBackground();
  fill(255);
  rect(0,0,width,height);
  ellipseMode(CENTER_DIAMETER);
  noStroke();
}
 
void loop() {
  
  fill(200,0,0,128 )  ;
 
  angle=(float)((millis()*32)%62832)*0.0001;
  ellipse(width*0.8*angle/TWO_PI, (millis()%100)*sin(angle)+height/2, mouseX>>2, mouseY>>2);
  fill(0,200,0,160);
  ellipse(width*0.8*angle/TWO_PI + (millis()%80)*cos(angle), 50*sin(angle)+mouseY/2 - 80*sin(angle), mouseX>>3, mouseY>>3);
  fill(mouseX,100,200,192);
  ellipse(width*0.8*angle/TWO_PI + 10*cos(angle) + 30*cos(2*angle), (millis()%50)*sin(angle)+height/2 + 60*sin(angle), mouseX>>3, mouseY>>3);
  fill(255,155,0);
  ellipse(width*0.8*angle/TWO_PI + 30*cos(angle) + 30*cos(6*angle), (millis()%40)*sin(angle)+height/2 + 80*sin(angle), mouseX>>3, mouseY>>3);
 
  for(angle=0; angle<width*height-2; angle++) {
    pixels[(int)angle]= ((pixels[(int)angle]>>16&0xaf)+(pixels[(int)angle+2]>>16&0xff))<<15&0xff0000 |
    ((pixels[(int)angle]>>8&0xff)+(pixels[(int)angle+2]>>8&0xff))<<7&0xff0a |
    ((pixels[(int)angle]&0xff)+(pixels[(int)angle+2]&0xff))>>1;
  }
 
}
« Last Edit: Aug 29th, 2003, 2:17pm by vent »  

http://www.shapevent.com/
arielm

WWW
Re: Processing tennis
« Reply #27 on: Aug 29th, 2003, 2:00am »

Jerronimo: kudos for your plans of making this online tennis site!
 
(btw, i guess we have these 2 hidden codes in common: Z80 & MC68000)
 

Ariel Malka | www.chronotext.org
benelek

35160983516098 WWW Email
Re: Processing tennis
« Reply #28 on: Aug 29th, 2003, 8:21am »

Jerronimo, that sounds like a great idea. actually, something that could return an applet when p5 code is given, would be an excelent feature on this board too. it'd be great if there was a lil' "play" button attached to all [ code ] snippets.
 
are we ready for round 2?
 
vent

WWW
Re: Processing tennis
« Reply #29 on: Aug 29th, 2003, 2:18pm »

I'm ready....
 

http://www.shapevent.com/
Pages: 1 2 3 4 

« Previous topic | Next topic »