## Re: [Pyode-user] Collision detection works fine in one direction, but not the other

 Re: [Pyode-user] Collision detection works fine in one direction, but not the other From: George - 2009-08-17 17:28:19 ```Well, I think I found the solution. The plane defines a ground-like object and not a paper-like infinitely thin surface as we're used to from math. So when the top_rail is used, the simulation assumes the ball is inside that ground object and goes crazy. Thanks for your help. On Mon, Aug 17, 2009 at 8:12 PM, Ian Mallett wrote: > Hi, > > Long answer: > -Look at the output with raw_input. > -The code presented seems to make the sphere fall, but then fall the other > direction, and back and forth until it settles at top_rail. > -Try setting the gravity to 0, and the ball goes up indefinitely. > -I recommend moving the two for loops together.  When the rails are removed, > you see that the sphere just sits there.  An interaction with the rail must > be starting the sphere moving.  This explains the earlier observation with > gravity.  It's the top rail, not the bottom rail. > -The problem only seems to occur when top_rail is over the sphere.  When it > is at the level of the sphere, the sphere moves up on top of it.  When it is > a little over the sphere, we see that the sphere is still moving up. > Intuitively, I flip the normal (and the distance argument).  The result is a > perfect simulation, even when the gravity is flipped. > > Short answer: > -Change top_rail=ode.GeomPlane(space, (0,1,0), 1.42) to > top_rail=ode.GeomPlane(space, (0,-1,0), -1.42). > > Ian > > > ```

 Re: [Pyode-user] Collision detection works fine in one direction, but not the other From: George - 2009-08-17 09:14:42 ```Actually, the code above works fine only if we remove the top_rail definition. That's a mystery as well. ```
 Re: [Pyode-user] Collision detection works fine in one direction, but not the other From: George - 2009-08-17 17:28:19 ```Well, I think I found the solution. The plane defines a ground-like object and not a paper-like infinitely thin surface as we're used to from math. So when the top_rail is used, the simulation assumes the ball is inside that ground object and goes crazy. Thanks for your help. On Mon, Aug 17, 2009 at 8:12 PM, Ian Mallett wrote: > Hi, > > Long answer: > -Look at the output with raw_input. > -The code presented seems to make the sphere fall, but then fall the other > direction, and back and forth until it settles at top_rail. > -Try setting the gravity to 0, and the ball goes up indefinitely. > -I recommend moving the two for loops together.  When the rails are removed, > you see that the sphere just sits there.  An interaction with the rail must > be starting the sphere moving.  This explains the earlier observation with > gravity.  It's the top rail, not the bottom rail. > -The problem only seems to occur when top_rail is over the sphere.  When it > is at the level of the sphere, the sphere moves up on top of it.  When it is > a little over the sphere, we see that the sphere is still moving up. > Intuitively, I flip the normal (and the distance argument).  The result is a > perfect simulation, even when the gravity is flipped. > > Short answer: > -Change top_rail=ode.GeomPlane(space, (0,1,0), 1.42) to > top_rail=ode.GeomPlane(space, (0,-1,0), -1.42). > > Ian > > > ```
 Re: [Pyode-user] Collision detection works fine in one direction, but not the other From: Leo Rocha - 2009-08-18 21:06:35 ```On Mon, Aug 17, 2009 at 7:28 PM, George wrote: > Well, I think I found the solution. The plane defines a ground-like > object and not a paper-like infinitely thin surface as we're used to > from math. So when the top_rail is used, the simulation assumes the > ball is inside that ground object and goes crazy. Hae you thought about that the surfaces are orientable (mathematical analysis) and that the vector is different from one side and the other? that is why acts like if it is solid in one side and a surface in the other. Best, Leonardo Manuel Rocha ```
 Re: [Pyode-user] Collision detection works fine in one direction, but not the other From: Ethan Glasser-Camp - 2009-08-19 00:06:26 ```Leo Rocha wrote: > On Mon, Aug 17, 2009 at 7:28 PM, George wrote: >> Well, I think I found the solution. The plane defines a ground-like >> object and not a paper-like infinitely thin surface as we're used to >> from math. So when the top_rail is used, the simulation assumes the >> ball is inside that ground object and goes crazy. > > Hae you thought about that the surfaces are orientable (mathematical > analysis) and that the vector is different from one side and the > other? that is why acts like if it is solid in one side and a surface > in the other. That said, I think it does behave like George says in the sense that it isn't infinitely thin, but instead infinitely deep. That's why it shoots up so fast at t=0, even when there's no force on it. Ethan ```