Allegro.cc Forums » Off-Topic Ordeals » Ball physics

 This thread is locked; no one can reply to it.
 Ball physics
 Johan Halmén Member #1,550 September 2001 {"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"}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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.
 GullRaDriel Member #3,861 September 2003 Doesn't it miss a bit of horizontal propagation ? "Code is like shit - it only smells if it is not yours"Allegro Wiki, full of examples and articles !!
 Johan Halmén Member #1,550 September 2001 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. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.
 GullRaDriel Member #3,861 September 2003 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' "Code is like shit - it only smells if it is not yours"Allegro Wiki, full of examples and articles !!
 Edgar Reynaldo Member #8,592 May 2007 Interesting experiment. I might be able to reproduce it with my own ball simulator. Elizabeth Warren for President 2020! | Modern Allegro 4 and 5 binaries | Allegro 5 compile guideKing Piccolo will make it so
 Johan Halmén Member #1,550 September 2001 GullRaDriel said: 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.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"}{"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"}{"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"} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Years of thorough research have revealed that the red "x" that closes a window, really isn't red, but white on red background.Years of thorough research have revealed that what people find beautiful about the Mandelbrot set is not the set itself, but all the rest.
 Go to: Allegro Development Installation, Setup & Configuration Allegro.cc Comments Off-Topic Ordeals The Depot Game Design & Concepts Programming Questions Recent Threads