Physics for Phun

Post Reply
KenB
Posts: 49
Joined: Sun Dec 03, 2006 12:40 am

Physics for Phun

Post by KenB »

Some of you might appreciate this:
http://www.youtube.com/watch?v=0H5g9VS0ENM
http://www.vrlab.umu.se/research/phun/

2D physics with iterative solver for contacts and constraints based on Claude Lacoursière's
work (mainly) and some of mine (iterative formulation and some improvements on symplectic
balance of impacts and contacts to preserve symmetries and energy better) and many
additional things by Emil Ernerfeldt, who also wrote the entire program.
It also has sph fluids (these will be improved a great deal in the next few weeks).
Don't forget to drag around the menues and try Emil's crazy gui. Physics everywhere...

Comments and suggestions are appreciated.

Cheers,
Kenneth

Image
Erin Catto
Posts: 316
Joined: Fri Jul 01, 2005 5:29 am
Location: Irvine
Contact:

Re: Physics for Phun

Post by Erin Catto »

Hi Kenneth,

This looks really nice! A had phun playing with it. :)

Will this project become open source? Will your team be publishing technical details on the implementation?

What are you using for the concave collision?

The stacking looks quite stable. Are you using any sort of shock propagation and/or breadth-first graph? I didn't notice any artifacts.

The mouse dragging is a little wonky because it tends to allow some deep overlap. I dragged one square on top of another and they began to hug each other.

Overall, a great job!

Cheers,
Erin
KenB
Posts: 49
Joined: Sun Dec 03, 2006 12:40 am

Re: Physics for Phun

Post by KenB »

Distance maps are used for free-form objects. They are quite efficient in 2D.
We'll publish more details when there's time and Emil's MSc thesis
report will also be available soon enough covering most of the details.
The code will most likely also be available when it's a bit cleaner, and
when we've decided where to go with Phun.
/Kenneth

Erin Catto wrote:Hi Kenneth,

This looks really nice! A had phun playing with it. :)

Will this project become open source? Will your team be publishing technical details on the implementation?

What are you using for the concave collision?

The stacking looks quite stable. Are you using any sort of shock propagation and/or breadth-first graph? I didn't notice any artifacts.

The mouse dragging is a little wonky because it tends to allow some deep overlap. I dragged one square on top of another and they began to hug each other.

Overall, a great job!

Cheers,
Erin
raigan2
Posts: 197
Joined: Sat Aug 19, 2006 11:52 pm

Re: Physics for Phun

Post by raigan2 »

KenB wrote:Distance maps are used for free-form objects. They are quite efficient in 2D.
It seems like you're calculating them really quickly.. are there any particular tricks, or are computers just fast enough these days?
emilk
Posts: 1
Joined: Thu Feb 14, 2008 11:16 pm

Re: Physics for Phun

Post by emilk »

Thanks for the responses!
Erin Catto wrote: The stacking looks quite stable. Are you using any sort of shock propagation and/or breadth-first graph? I didn't notice any artifacts.

The mouse dragging is a little wonky because it tends to allow some deep overlap. I dragged one square on top of another and they began to hug each other.

Overall, a great job!

Cheers,
Erin
The solver is completely Gauss-Seidel, no shock propagation or anything of the sort. The reason the stacks are so stable that I'm using a really slow convergence over several time steps. This also leads to the problem you described.
The boxes are just like any other polygons, and uses distance maps for collision detection. This is far from ideal and will be resolved in a future version.

raigan2 wrote:
KenB wrote:Distance maps are used for free-form objects. They are quite efficient in 2D.
It seems like you're calculating them really quickly.. are there any particular tricks, or are computers just fast enough these days?
The distance maps are only 128x128 big which allows them to be calculated fairly quickly. I use a simple but fast breadth-first approach for calculating them.

The distance maps are also used for rendering, and in both cases I use linear interpolation. This means that the visualization of a polygon corresponds exactly to its implicit definition.


/Emil Ernerfeldt
DannyChapman
Posts: 84
Joined: Sun Jan 07, 2007 4:29 pm
Location: Oxford, England
Contact:

Re: Physics for Phun

Post by DannyChapman »

This is very nice and fun to play/experiment with.

However, I did create a "Newton's Cradle" - 5 balls suspended on highly-damped/strong springs, initially at rest, side by side, and touching each other. When one is dragged to one side, it bounces off the 4 other balls, rather than propagating the shock through the other balls. I'm guessing this is due to using an LCP solver for the collisions?
Attachments
Newton.zip
(909 Bytes) Downloaded 649 times
raigan2
Posts: 197
Joined: Sat Aug 19, 2006 11:52 pm

Re: Physics for Phun

Post by raigan2 »

I'd love to hear how this solver works, I remember trying to read the "regularized variational methods" thesis and failing completely to understand :(
rje
Posts: 2
Joined: Mon Jan 14, 2008 11:08 am

Re: Physics for Phun

Post by rje »

Does this use the GPU for collision calculations? I noticed the vertex/fragment shader source code in the install directory...
KenB
Posts: 49
Joined: Sun Dec 03, 2006 12:40 am

Re: Physics for Phun

Post by KenB »

No, it uses shaders för the water rendering among other things.
KenB
Posts: 49
Joined: Sun Dec 03, 2006 12:40 am

Re: Physics for Phun

Post by KenB »

There's a new website for Phun: http://www.phunland.com/
Phun itself has also been substantially updated since the last post here, and new versions later this fall/winter will have some really cool things, never seen before...
Post Reply