Trajectory & collision detection of multiple objects help
I’ve been trying to do some simple physics simulations using
jit.gl.sketch, using 2 spheres rolling around, sort of simulating 2
balls on a pool table. Can anyone point me in the right direction of
how to figure out the trajectory of the balls after colliding with each
other? The collision detection is easy, but I can’t figure out the
math of how to bounce them in the proper direction after colliding.
I’ve looked at the ‘trajectory’ patch from
http://cicm.mshparisnord.net/dl/trajectory.htm but it’s difficult to
figure out what the heck is going on, as it’s a very very thick patch.
Has anyone on the list done anything like this they’d like to share?
I’m interested in hitting or pushing one ball, calculating it’s speed
and angle, and applying that to the collision with another object to
calculate the new trajectories of both objects, plus I’d like to add
some real world variables, such as mass, friction, elasticity, and
The PMPD library will be your best friend!
http://www.maxobjects.com/?v=libraries&id_library=81& ;requested=PMPD&operateur=AND& id_plateforme=0
Originally made for PD, these objects have been ported for max (osX & win),
but as most of help file are missing/unusable, and there are no example
patches for max/jitter (there are help patches script-converted from PD
patch. unclear and not very useful) I would really advice you to check the
PD version first, (very easy, just open the doc/example/pmpd patches) justto understand how it works, and then try to patch in max.
(there are a couple of max example in Ali Momeni (osX) max port :
< http://www.cnmat.berkeley.edu/%7eali/share/max/pmpd/pmpd-for -max.sit >
And I can post a couple of patches that do the kind of thing you’re looking
for (spheres on a 2D pool table, with bounce, friction, attraction,.). as
soon as I will have bought a new HD, reinstalled everything and restored my
backup files. cause I had a terrible HD crash this morning!
You can have a look at this small video of a patch I made with PMPD objects:
Have fun with PMPD (I did!)
Thanks Mathieu! I was playing with that too by the way, but I wasn’t
sure where to begin.
I’d love to see some example patches.
Here is an example of using the great PMPD library (Physical modelling) in
max/Jitter to simulate balls on a pool table (2d environment – collision /
friction / gravity / attraction…)
Have fun !
I’ve finally had a minute to check out your patch on your site. Very
cool!!! Can I hire you to make a patch for me? I need something
super simple, simpler than the patch (perhaps) you’ve already created.
Here is what I’m working on:
What I need is to add ability to kick a ball or 3d object around, but
have to ability (like your patch) to add gravity, so I can use this on
a wall too. I would like to be able to have the spheres rotate in the
direction they are rolling too. I would also like to apply various
textures to the balls, or use other 3d objects that are imported, which
could be anything from light bulbs, to logos, or 3d heads. What do you
think??? Interested? Where are you located?
I’m working on this project with Peter Nyboer-I guess he is friends
with Ali too. My Jitter knowledge is about at a moderate skill level
to say the least. I’m better at making the stuff look good, than
making it work properly.
Sorry list and Matthieu,
I accidently posted my last message to the list instead of Matthieu
personally, but since it’s out there, anyone interested in adding to
the project, email me!