Ball physics
Johan Halmén

{"name":"612168","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/5\/254edda42748948b8d549a23dfe5d40e.png","w":1022,"h":675,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/5\/254edda42748948b8d549a23dfe5d40e"}612168

A simulation where I drop a ball (of size 0) and have it bounce against eight black pegs to see where it lands. The bottom edge goes through the colour spectrum. Each pixel of the image is a starting position for the ball. The starting position is coloured by the position where the ball crosses the bottom edge. If the ball goes outside the left or right edge, the colour fades to black.
When a bounce happens, the tangent is calculated. The velocity of the ball is divided into a tangent and a normal component. The normal component is negated and loses 30 % of its length.
There are some smooth regions in the final image, but there is chaos, too. The chaos implies there are more collisions before the ball hits the bottom edge.

GullRaDriel

Doesn't it miss a bit of horizontal propagation ?

Johan Halmén

What do you mean? The propagation is in the colours. F.i. each yellow pixel in the image is a starting point where the ball travels through collisions to the horizontal spot on the bottom edge, where the colour is yellow. You see a lot of yellow areas above the yellow spot, but also further to the right, above the fourth and the fifth black peg.
Something strange happens right above each black peg. I must turn on the path tracking to see what it is. It seems the ball sticks to the surface until it drops down right under the peg. Either that or then the ball travels through the peg, if it happens to be placed on the surface of the peg without velocity. What it should do is it should roll off the peg and fall straight vertically down at the left or right edge.

GullRaDriel

I mean that It's only propagating vertically where the ball have fallen. It should be also expanding to the surroundings, which I was implying by 'horizontally'

Edgar Reynaldo

Interesting experiment. I might be able to reproduce it with my own ball simulator.

Johan Halmén

It should be also expanding to the surroundings, which I was implying by 'horizontally'

What surroundings? If the ball flew off the right or left edge before reaching the bottom level (y coordinate 650), the starting point was painted black.

And I do have an error in the collision routine. At a vertical speed near zero, when the ball should just roll along the surface of the peg, it suddenly falls through the peg. It's like I'd need a different routin for collision and for rolling on the surface. The collision routine doesn't simulate rolling on the surface, when the collision speed is zero and distance is zero.

<edit />

Some more images:
{"name":"612173","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/1\/b10e23948ee3d0cc43c8982fd9a33799.png","w":1026,"h":677,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/1\/b10e23948ee3d0cc43c8982fd9a33799"}612173
{"name":"612171","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/c\/4c17edeece20bedf92216e3c28e3dc9f.png","w":1026,"h":677,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/c\/4c17edeece20bedf92216e3c28e3dc9f"}612171
{"name":"612172","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/c\/7c58ffdfb5ec5d4552f638aa7d34e90c.png","w":1026,"h":677,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/c\/7c58ffdfb5ec5d4552f638aa7d34e90c"}612172

Thread #617946. Printed from Allegro.cc