PSystem ps; Arcball arcball; Surface bone; class NoShowParticle extends Particle { public NoShowParticle() { } void draw() { // Do nothing in draw } } class RightParticle extends Particle { float startX; public RightParticle() { fix(); } void draw() { if (age == 0) { startX = pos[0] - 300; } pos[0] = startX + 400 * sin(age/150.0 + 3*PI/4); age++; } } class RectParticle extends Particle { public RectParticle() { Magnet m = ps.addMagnet(this); m.strength = -50; } void draw() { if (fixed()) { fill(#FF0000); } else { fill(200); } super.draw(); } } void setup() { size(500,500); arcball = (Arcball)loadPlugin("Arcball"); ps = (PSystem)loadPlugin("PSystem"); ps.setGravity(0); bone = ps.loadSurface("bone.obj"); bone.setTexture("rods.jpg"); bone.scale(10); bone.applyParticles("Layer_01", new RightParticle()); bone.applyParticles("Layer_02", new NoShowParticle()); bone.applyParticles("Layer_03", new NoShowParticle()); bone.attachParticleToCentroid("Layer_01", 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, 255); stroke(100, 100, 100, 100); bone.draw(); ps.draw(); }