Processing JS
- Started
- Last post
- 15 Responses
- stewdio
Let's play! All you need is your browser. (Assuming you're not on IE of course.)
http://processingjs.org/learning…. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
var h = 0;
var x = 0;
var y = 0;void setup()
{
size( 250, 250 );
frameRate( 60 );
strokeWeight( 2 );
colorMode( HSB, 359 );
};void draw()
{
background( 0, 0, 0, 30 );
var xOld = x;
var yOld = y;stroke( h, 359, 359 );
x = random( width );
y = random( height );
line( xOld, yOld, x, y );noStroke();
fill( h, 359, 359, 180 );
ellipse( x, y, 20, 20 );
h ++;
};
- bigtrickagain0
var h = 0;
var destinationx = 0;
var destinationy = 0;void setup()
{
size( 250, 250 );
frameRate( 20 );
strokeWeight( 2 );
colorMode( HSB, 359 );
};void draw()
{
var xOld = destinationx ;
var yOld = destinationy;
var i = 0;
stroke( h, 359, 359 );
destinationx = random( width );
destinationy = random( height );
for(i = 0; i < 10; i++) {
xstep = (destinationx - xOld) / 10;
ystep = (destinationy - yOld) / 10;ellipse( xstep * i + xOld, ystep * i + yOld, i +1, i+1);
}
h ++;
};- your turn!bigtrickagain
- Just tried your code. Very nice :)stewdio
- stewdio0
Here's another. It's like a colorful moire pattern radar. Just copy this code and paste it into the code box (replacing what's already there) on the Processing JS page : http://processingjs.org/learning…
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
var r = 600;
var d = 0;
var h = 0;void setup()
{
size( 250, 250 );
frameRate( 60 );
strokeWeight( 1 );
colorMode( HSB, 359 );
background( 0, 0, 0 );
};void draw()
{
background( 0, 0, 0, 10 );
stroke( h, 359, 359 );
x = ( width / 2 ) + Math.cos( radians(d) ) * r;
y = ( height / 2 ) + Math.sin( radians(d) ) * r;
line( width/2, height/2, x, y );
d += 2;
h ++;
};
- bigtrickagain0
aside: using firebug's debugger along with the in-browser processing test page makes it super-easy to develop - excellent!
- ukit0
Wow, this is pretty sweet. Is it possible to load images?
- http://processingjs.…acescence
- Oh OK, security restrictions mean it has to be on the same serverukit
- bigtrickagain0
man, people do some kinky shit with processing. witness:
http://complexification.net/gall…and all these were from 2005, too
- I like these because they seem organic .. remind me of geological textures.lukus_W
- stewdio0
♫
What's that coming over the hill?
Is it a monster?
Is it a monster??
- ukit0
- stewdio0
var r = 0;
var d = 0;
var h = 0;
void setup()
{
size( 250, 250 );
frameRate( 60 );
strokeWeight( 2 );
colorMode( HSB, 359 );
background( 0, 0, 0 );
};
void draw()
{
background( 0, 0, 0, 10 );
stroke( h, 359, 359 );
noFill();
r = Math.sin( radians( h )) * 120;
x = ( width / 2 ) + Math.cos( radians(d) ) * r;
y = ( height / 2 ) + Math.sin( radians(d) ) * r;
ellipse( x, y, abs( r ), abs( r ));
d += 2;
h ++;
};
- stewdio0
Who else is up for a try?
http://processingjs.org/learning…
- PIZZA0
void setup()
{
size( 250, 250 );
frameRate( 60 );
strokeWeight( 2 );
stroke(255,255,255);
noFill();
background( 0, 0, 0 );
};
void draw()
{
stroke(234,198,181);
ellipse( 40,140, 40, 40);
ellipse( 70,170, 40, 40);
line(120,30,50,120);
line(160,50,90,160);
stroke(215,92,145);
ellipse( 140,40, 40, 40);
line(140,40,155,25);
}
- stewdio0
^
|
|
|
- PIZZA0
2.0
void setup() {
size( 250, 250 );
frameRate( 30 );
strokeWeight( 2 );
stroke(255,255,255);
background( 0, 0, 0 );
};
void draw() {
noFill();
stroke(234,198,181);
ellipse( 40,140, 40, 40);
ellipse( 70,170, 40, 40);
line(120,30,50,120);
line(160,50,90,160);
stroke(215,92,145);
ellipse( 140,40, 40, 40);
line(140,40,155,25);
stroke(255,255,255);
line(155,25,180+random(40),0+ran...
fill(0,0,0,10);
rect(0,0,250,250);
}
- PIZZA0
QBN ate a long line
void setup() {
size( 250, 250 );
frameRate( 30 );
strokeWeight( 2 );
stroke(255,255,255);
background( 0, 0, 0 );
};
void draw() {
noFill();
stroke(234,198,181);
ellipse( 40,140, 40, 40);
ellipse( 70,170, 40, 40);
line(120,30,50,120);
line(160,50,90,160);
stroke(215,92,145);
ellipse( 140,40, 40, 40);
line(140,40,155,25);
stroke(255,255,255);
line(155,25,180 +
random(40),0 + random(20));
fill(0,0,0,10);
rect(0,0,250,250);
}
- stewdio0
Clearly @PIZZA is an evil genius not to be toyed with.