PSystem ps; Arcball arcball; Surface bone; Particle p; class RectParticle extends Particle { public RectParticle() {} void setup() { Spring s = ps.addSpring(p, this); s.restLength = 50; s.strength = 0.1; } void draw() { if (fixed()) { fill(255, 0, 0); } else { fill(100, 100, 100, 100); } super.draw(); } } void setup() { size(500,500); arcball = (Arcball)loadPlugin("Arcball"); ps = (PSystem)loadPlugin("PSystem"); ps.setGravity(0); bone = ps.loadSurface("bone.obj"); bone.scale(10); p = new RectParticle(); p.fix(); ps.addParticle(p); Magnet m = ps.addMagnet(p); m.strength = -20; bone.applyParticles("Layer_01", new RectParticle()); bone.applyParticles("Layer_02", new RectParticle()); bone.applyParticles("Layer_03", new RectParticle()); bone.addSpringsToOriginalShape("Layer_01"); bone.addSpringsToOriginalShape("Layer_02"); bone.addSpringsToOriginalShape("Layer_03"); } void loop() { background(100, 200, 50); translate(width/2, height/2); arcball.run(); fill(200, 200, 200); stroke(100, 100, 100, 100); bone.draw(); ps.draw(); p.setPos(100*sin(p.age/28.0f), 200*sin(p.age/50.0f), 0); p.age++; }