2/15/2024


Final p5 Sketch: Trampoline

I was gonna make jello after watching the spring forces video but …

The trapezoidal shape of jello made the upper particles collapse from gravity. Without gravity, there’s no jiggle or bounce in the actual jello.

Untitled

I also went back and tried being more specific about the rest length using pythagorean. Might need to look more into detailing the spring force or gravity force to get the desired effect.

On the other hand, this table shape was rather stable, and it was easy to adjust the rest length / displacement to control the bounce.

Balls were made (gravity applied) when the mouse was pressed. When the ball is about to intersect with the trampoline, a (0, -1) force was applied to have it bounce back up.

Untitled

Untitled

I added a loop for the width of the trampoline so any intersection point along the trampoline would cause the ball to bounce back.

I also changed from balls dropping with mouse press to mouse released, which cleaned up the ball drop to 1 at a time.

I also made a pseudo floor platform that would stop movement when it drops. At the same time, I added edges back around the canvas to have the ball bounce back.

Untitled

I added a wind force with key press of space bar to apply in direction of the mouse position. Then, I made a small edge along the sides of the trampoline too. Although an occasional ball would get through to the center and roll past the edge.


I also tried making a bouncing ball type of bubble with springs. I made a circle with polar coordinates and added a spring in between each particle. I set the rest length of the spring to a calculated estimate based on the circumference and number of particles given an angular increment of 0.4 (estimation because it doesn’t divide evenly).

I used mouse position for wind direction and applied the force when the mouse is pressed.

The problem is that the bubble doesn’t retain its shape and eventually collapses on itself.

[p5 Sketch](https://prod-files-secure.s3.us-west-2.amazonaws.com/4404c04e-63b4-4587-86f7-0493aa02b643/081007eb-e7ad-4abb-9baa-db4c9d2f29da/Untitled.qt)

p5 Sketch

I tried making more of an asterisk exo-skeleton of a sphere with springs and particles. However, even if I set the rest length of the spring to the distance between the particle and a center particle, it would eventually collapse in an erratic fashion.

Untitled

I think the solution might be to bound the spring force to a set range so it won’t collapse into the center point or go past the center point but haven’t had a lot of progress in making one nor am I entirely sure of how it would work in theory.