We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Building a double pendulum with traer.physics
Page Index Toggle Pages: 1
Building a double pendulum with traer.physics (Read 410 times)
Building a double pendulum with traer.physics
Jan 21st, 2009, 10:00pm
 
Hi folks,
I am playing around with traer.physics building a double pendulum. I've started with the pendulum example from the traer.physics website, but I am already lost...

I like to switch off the spring (the boing-boing). The line shoud be like a pole, not like a rubber rope.
Does anybody can give me a hint on this?

This is the code example from traer.physics

import traer.physics.*;

ParticleSystem physics;

Particle p;
Particle anchor;
Spring s;

void setup()
{
 size( 400, 400 );
 smooth();
 fill( 0 );
 ellipseMode( CENTER );

 physics = new ParticleSystem( 5.0, 0.05 );
 p = physics.makeParticle( 1.0, width/2, height/2, 0 );
 anchor = physics.makeParticle( 1.0, width/2, height/2, 0 );
 anchor.makeFixed();
 s = physics.makeSpring( p, anchor, 1.0, 0.1, 100 );
}

void draw()
{
 if ( !mousePressed )
   physics.advanceTime( 1.0 );
 else
 {
   p.moveTo( width/2+1, 0, 0 );
 }

 background( 255 );

 line( p.position().x(), p.position().y(), anchor.position().x(), anchor.position().y() );
 ellipse( anchor.position().x(), anchor.position().y(), 5, 5 );
 ellipse( p.position().x(), p.position().y(), 20, 20 );
}
Re: Building a double pendulum with traer.physics
Reply #1 - Jan 22nd, 2009, 2:08am
 
Hi guys!
I found this awesome double pendulum made by Daniel Staudigel.
This will help!

http://www.uweb.ucsb.edu/~dstaudigel/double_pendulum/index.html
Page Index Toggle Pages: 1