Created
April 26, 2011 10:59
-
-
Save medecau/942111 to your computer and use it in GitHub Desktop.
This file contains 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
import fisica.*; | |
//import processing.video.MovieMaker; | |
//MovieMaker mm; | |
FWorld world; | |
void setup(){ | |
size(800,600); | |
smooth(); | |
//mm = new MovieMaker(this, width, height, "demo.mov", | |
// 30, MovieMaker.ANIMATION, MovieMaker.HIGH); | |
Fisica.init(this); | |
world=new FWorld(); | |
world.setGravity(0,0); | |
FCircle s = new FCircle(40); | |
s.setPosition(width/2,height/2); | |
s.setStatic(true); | |
s.setFill(255,0,0); | |
world.add(s); | |
FCircle p = new FCircle(40); | |
p.setVelocity(400,0); | |
p.setDamping(0); | |
p.setFill(0,63,195); | |
world.add(p); | |
FDistanceJoint g = new FDistanceJoint(s,p); | |
g.setLength(0); | |
g.setFrequency(0.5); | |
g.setDamping(0); | |
world.add(g); | |
} | |
void draw(){ | |
background(255); | |
world.step(); | |
world.draw(); | |
//mm.addFrame(); | |
} | |
/* | |
void keyPressed() { | |
if (key == ' ') { | |
mm.finish(); | |
} | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment