## pyode-user

 [Pyode-user] Sandwich plane From: Simon Wittber - 2006-01-07 15:02:16 ```I'm attempting to use PyODE for a 2D platform game. The below code is not doing what I expect. self.space =3D space =3D ode.Space() self.back =3D ode.GeomPlane(space, (0,0,1), 1) self.front =3D ode.GeomPlane(space, (0,0,-1),-1) What I want to do is sandwich my world between two vertical infinite planes. Am I going about this the right way? -Sw. ```
 Re: [Pyode-user] Sandwich plane From: Matthias Baas - 2006-01-08 21:44:23 ```Simon Wittber wrote: > I'm attempting to use PyODE for a 2D platform game. > > The below code is not doing what I expect. > > self.space = space = ode.Space() > self.back = ode.GeomPlane(space, (0,0,1), 1) > self.front = ode.GeomPlane(space, (0,0,-1),-1) I believe the distance of the second plane should be +1 (as you have already inverted the normal), otherwise both planes coincide and the simulation most certainly goes haywire. Apart from that, I'm not sure if your technique is a good idea at all. I wouldn't be surprised if the simulation does weird things sooner or later because ODE smashes the objects from one plane to the other and accumulates high velocities in your undesired third dimension. You may probably want to set the Z values of all positions and velocities to zero after each simulation step (in which case the above planes might even be superfluous). Of course, the best solution would be to switch to a true 2D simulator as this one could be much more efficient than a full 3D simulator projected back to 2D. - Matthias - ```
 Re: [Pyode-user] Sandwich plane From: Simon Wittber - 2006-01-09 01:14:06 ```On 1/9/06, Matthias Baas wrote: > Apart from that, I'm not sure if your technique is a good idea at all. I > wouldn't be surprised if the simulation does weird things sooner or > later because ODE smashes the objects from one plane to the other and > accumulates high velocities in your undesired third dimension. > You may probably want to set the Z values of all positions and > velocities to zero after each simulation step (in which case the above > planes might even be superfluous). Hmm I might try this. > Of course, the best solution would be to switch to a true 2D simulator > as this one could be much more efficient than a full 3D simulator > projected back to 2D. Thanks for the feedback. I agree, however, I cannot find a 2D simulator. Do you know of any such thing? Before I started using ODE, I started coding a 2D simulator using Numeric. However, my knowledge of physics is not enough to finish the job. -Sw. ```
 Re: [Pyode-user] Sandwich plane From: Matthias Baas - 2006-01-09 21:26:17 ```Simon Wittber wrote: >>Of course, the best solution would be to switch to a true 2D simulator >>as this one could be much more efficient than a full 3D simulator >>projected back to 2D. > > Thanks for the feedback. I agree, however, I cannot find a 2D > simulator. Do you know of any such thing? No, sorry. > Before I started using ODE, I started coding a 2D simulator using > Numeric. However, my knowledge of physics is not enough to finish the > job. Well, as long as ODE does the job without being the bottleneck in your game there's probably no need to write a new simulator anyway. By the way, don't forget to post a message when you've finished the game... ;) - Matthias - ```
 Re: [Pyode-user] Sandwich plane From: Chris McCormick - 2006-01-09 01:53:43 ```On Sat, Jan 07, 2006 at 11:02:12PM +0800, Simon Wittber wrote: > I'm attempting to use PyODE for a 2D platform game. > > The below code is not doing what I expect. > > self.space = space = ode.Space() > self.back = ode.GeomPlane(space, (0,0,1), 1) > self.front = ode.GeomPlane(space, (0,0,-1),-1) > > What I want to do is sandwich my world between two vertical infinite > planes. Am I going about this the right way? Hi Simon, I beleive it's possible to use ODE as a 2d engine just by keeping all your z values at zero. Check out tutorial2.py in the examples that come with PyODE. That is, make everything in your world have no thickness and no z values at all. Best, Chris. ------------------- chris@... http://mccormick.cx ```
 Re: [Pyode-user] Sandwich plane From: Thomas Paviot - 2006-01-09 21:41:07 ```
I'm attempting to use PyODE for a 2D platform game.  The below code is not doing what I expect.          self.space = space = ode.Space()         self.back = ode.GeomPlane(space, (0,0,1), 1)         self.front = ode.GeomPlane(space, (0,0,-1),-1)  What I want to do is sandwich my world between two vertical infinite planes. Am I going about this the right way?
Hi Simon,  I beleive it's possible to use ODE as a 2d engine just by keeping all your z values at zero. Check out tutorial2.py in the examples that come with PyODE. That is, make everything in your world have no thickness and no z values at all.  Best,  Chris.
Hello,

A patch for a Plane2D joint is available on the Ode mailing list archive. With a little hack on PyOde, maybe this new joint type could be available for Python.

Here is a link to this patch:

http://q12.org/pipermail/ode/2003-November/010325.html
;
Thomas
```