Path Following (Simon’s own code). Applying restitution.

On Thursday Simon was busy with writing his own code in Java. He called it “Path Following”. The project basically involved simulating different phenomena with a physics particle (having it follow a path, fall and bounce).

The most interesting part of this challenge Simon invented for himself was applying restitution to make the particle bounce in a realistic way (Simon failed several times but eventually succeeded). “If a bound hits the physics particle I’m going to multiply the physics particle’s velocity by -0.8 (0.8 is the arbitrary restitution, so I multiply the velocity by the negative restitution)”, Simon explained.

He also planned to incorporate collision detection in this project but didn’t succeed.

Here the particle is drawing a graph (“noise without a noise function”):

Here Simon adds one more particle and is trying to create collision detection and make the particles restitute:

Debugging and using inheritance for the second particle:

Making the particle remember the graph:

Applying gravity to the physics particle:

Trying to make the physics particle bounce (apply restitution). In this video Simon doesn’t succeed.

Simon manages to control the particle’s bounce (with the mouse) but there’s still no restitution:

In the following video Simon finally won: he figured out how to apply restitution to the bouncing particle making it look like a bouncing ball. After a few bounces however, the particle collapsed (Simon solved the collapsing problem later on: in his code, the < and > should be <= and >=).

In a steering behavior variation, trying to teach a particle to follow a given path (road). Simon hoped to apply a genetic algorithm here but got stuck:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s