Forums > Jitter

jit.phys.body infinite movement within a sphere

June 21, 2012 | 3:23 pm

Hi,
Sorry for this question but I can’t figure out how to accomplish it…
I want just to pick (with the mouse) a jit.phys.body and I want the object bouncing infinitely inside a sphere.

Is this possible?

Any help would be appreciated

All the best,

e69


June 21, 2012 | 6:00 pm

you should be able to set jit.phys.body @damping 0 0, @friction 0 and @restitution 1, and jit.phys.world @gravity 0 0 0.

then when you send an impulse to the rigid-body, it will bounce forever.

give that a try let me know if it doesn’t work.


June 21, 2012 | 9:48 pm

Thank you very much Robert!

But doesn’t work for me.
Here’s the patch from help file.
And is possible to have others shapes of world other than a worldbox?

All the best,

e69

– Pasted Max Patch, click to expand. –

June 22, 2012 | 6:21 pm

ahh yes. the problem is that the planes used in the worldbox are really more of a helper feature. you can’t set the material properties on them.
the solution is to create your own world bounds, using jit.phys.body, and setting the properties mentioned above.

eg, in the phys.body help patch, there is a cube shape rigid body that is scaled and positioned to be the "floor"

try using 6 static rigid bodies, instead of the worldbox, and your ball should bounce forever.


June 22, 2012 | 11:41 pm

Thanx again Robert!

It works but the sphere begins to accelerated and accelerated until it’s start again… Any idea?

Here’s the example,

All the best,

e69

– Pasted Max Patch, click to expand. –

June 25, 2012 | 10:08 pm

i think this is just what happens when you set the @restitution to 1. perhaps try setting it to 0.99?


June 26, 2012 | 10:07 am

Same thing, nothing change with @restitution to 0.99….
Press one or two times [impulse 1 1 1] and you will see.
Any idea?

Best,

e69

– Pasted Max Patch, click to expand. –

June 26, 2012 | 5:24 pm

maybe try asking at the bullet forum. bullet is the physics engine used behind the scenes in the jit.phys objects.

http://www.bulletphysics.org/Bullet/phpBB3/


June 28, 2012 | 5:59 pm

Ooops, I just found a library PMPD to do that….
I’m sorry but I thought this was much more simple…

Anyway thank you for your answers.

All the best,

e69


July 28, 2012 | 8:15 pm

I’m making a beer pong emulation for Kinect in which the ball and rims of the cups are jit.phys.body objects and I am struggling to get the ball to move naturally. There are two issues. There seems to be a significant amount of air resistance even when damping is 0. and the ball rolls across the tops of the cups rather than bouncing even when restitution is set to 1. for both the cups and the ball. Both objects have mass 1. and the cups have kinematic 1. so that they will not move when struck. I would paste the patch but you need the kinect to use it properly. Any suggestions?


July 28, 2012 | 8:42 pm

hard to say without seeing the patch.
have you tried adjusting the friction values?

try removing the kinect part and replacing it with something like a drunk object before posting it.


July 29, 2012 | 3:53 pm

looking forward for any news! :)


July 27, 2014 | 8:33 am

Here’s a patch in which balls in a box are given an impulse by respective bands of the bark scale (25 bands, 24 of which are divided across each ball; 6 impulses upon each ball for each direction).

Would be really exciting to create this with a sphere, capsule, cone, ice-cream sandwich, etc. whatever shape you would add to the phys.world object – any plans to do so?


Viewing 13 posts - 1 through 13 (of 13 total)