Physics example

Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines

Moderators: jesterKing, stiv

Post Reply
malCanDo
Posts: 1
Joined: Mon Oct 21, 2002 1:44 pm
Location: Ireland
Contact:

Physics example

Post by malCanDo »

Hi there,

I created a simple scene ( monkey heads falling down ) as a quick test for the physics engine.

EDIT: No more monkey heads, just normal boxes etc. Make sure to check out the multiple scenes.

http://www.candointeractive.com/blender ... Test.blend

Press P, and you'll see that currently this does not work very well at all in the latest builds of Blender.


I downloaded the T2 build, and tried changing the selected physics solution ( to ODE etc ), and when pressing P, the exact same thing seemed to happen for all of the selected physics engines.

Can someone confirm this? Maybe the physics engine selection is broken in the latest T2 build from the TestingBuilds forum?


Mal
Last edited by malCanDo on Thu Nov 25, 2004 12:19 am, edited 2 times in total.

Doc_Holiday
Posts: 2
Joined: Sat Jul 05, 2003 1:03 am
Contact:

Post by Doc_Holiday »

Thanks for that, but that Demo slows down my 2GHz - GForceFX Machine down to 2 FpS! Physics are really expensive. :D

malCanDo
Posts: 1
Joined: Mon Oct 21, 2002 1:44 pm
Location: Ireland
Contact:

Post by malCanDo »

Hi Doc,

> Physics are really expensive

That's my point... they shouldn't be that expensive, especially with such a simple demonstration.

Other solutions can handle huge amounts of stacked objects.

If there was a stable physics simulation, this could be rolled back into the animation engine ( maybe with a higher substep count for greater accuracy ) for some very cool effects.

At the moment, Ton is working on a soft body simulation ( for cloth etc ). If it could interact with the rigid body solution, a lot more time would be spent looking at and enhancing the physics engine as a whole.

Mal

ElBarto
Posts: 0
Joined: Fri Jun 11, 2004 3:24 pm
Location: Berlin
Contact:

Post by ElBarto »

You can really fasten it when you selecting Sphere as Bounds type then Polyheder.

Maybe put this problem into the bugtracker, it seems the polyheder code needs a lot of optimisation :(
Karamba!
Bart.

http://www.area42.de/

Blender Feature Proposal:
http://www.neeneenee.de/blender/features/

Metallica
Posts: 6
Joined: Thu Oct 17, 2002 12:46 am

Post by Metallica »

i hope softbody brings more attention to the physics engines. if softbodies is done for rendering. would it be easily possible for realtime game engine? because i would guess they would have a quick realtime physics calculation before rendering. i hear there will be a T3 i hope this is not supposed to be a secret. i don't want to get in trouble :oops:

z3r0_d
Posts: 289
Joined: Wed Oct 16, 2002 2:38 am
Contact:

Post by z3r0_d »

Metallica wrote:i hope softbody brings more attention to the physics engines. if softbodies is done for rendering. would it be easily possible for realtime game engine? because i would guess they would have a quick realtime physics calculation before rendering. i hear there will be a T3 i hope this is not supposed to be a secret. i don't want to get in trouble :oops:
it wouldn't be a good idea [imho], rigid bodies are hard enough already

blender is unreasonably slow with physics already it seems, but not having stuided the code much I can't say why

also, as much as I want to, it isn't really reasonable to compare blender to anything because it does things a lot different than everything else I've played with. While static triangle meshes, and non-rotating dynamic spheres is very easy to do [particulary with a n^2 collision detection algorythm] and pretty fast [say, only 50 spheres and 3k triangles], blender allows for a lot more flexible things and mixing of many types of dynamic objects [fh floating? fh rotating? having input coming from python or motion actuators? objects along ipo... more than just sphere bounds].

that said, it does do interesting things sometimes, for example a cube falling from a distance will always bounce like it landed on one corner, even if it lands flat on a face. Sure, it can probably explained that collision points aren't attempted to be solved at once [but one at a time, so, it sees the corner then just goes with that collision], but it sure can look peculiar.

ODE is cool, but it also has some weird issues [objects with high mass will bounce through the ground, it is kinda fun to watch but looks really weird, also a stack of massive objects will sink through other bricks in the same stack]

*shrug*
my ramblings probably aren't getting us very far

but I like to ramble

SOLID is supposedly very fast for collision detection, so it is peculiar that blender works so hard on the physics. I am a bit curious as to what it is trying to do [well, other than account for all of the special cases] that makes it so slow. Blender has a hard time with a fair number of objects [less than a hundred, but near it] which [even though they don't fall asleep] does seem odd.

kay, enough rambling I need to get some sleep

malCanDo
Posts: 1
Joined: Mon Oct 21, 2002 1:44 pm
Location: Ireland
Contact:

Post by malCanDo »

> SOLID is supposedly very fast for collision detection

I think a good test would be to have SOLID for collision detection, and use ODE for the dynamics.

Mal

alien-xmp
Posts: 0
Joined: Sun Apr 06, 2003 2:22 pm
Location: Wellington, New Zealand
Contact:

Post by alien-xmp »

Doing a test like that is a *really* stressful test for the physics engine.

Firstly, some of those objects are not "set smooth." This means you have maximum amount of vertices, ie 3*num faces.

Secondly, polyheder is for special effects, not for everything. It is very expensive checking triangles over checking objects.

It's also not possible to switch physics engines at run time (only at compile time at the moment, and I think ODE needs some work to compile.)

malCanDo
Posts: 1
Joined: Mon Oct 21, 2002 1:44 pm
Location: Ireland
Contact:

Post by malCanDo »

> Secondly, polyheder is for special effects, not for everything. It is very expensive checking triangles over checking objects.

What would the option be for automatically creating a convex hull around a concave object? It would be good if this was the default for moving objects, with box / sphere being an option for optimising those type of shapes, and a further option for allowing concave object meshes to be used directly for accuracy.

> It's also not possible to switch physics engines at run time (only at compile time at the moment, and I think ODE needs some work to compile.)

T2 gives the option on a drop down list... is this list invalid then? ( ie it always selects SUMO )

Mal

alien-xmp
Posts: 0
Joined: Sun Apr 06, 2003 2:22 pm
Location: Wellington, New Zealand
Contact:

Post by alien-xmp »

You can make a convex hull as invisible+collision geometry. I don't know if it can be done automatically, it sounds very nontrivial.

Yes, tuhopuu2 always selects sumo. (Unless it's been built with ODE, where it will always select ODE.)

Currently, the SOLID engine doesn't use any hull testing (QHull) although it can - the geometry has to be instanced differently.

malCanDo
Posts: 1
Joined: Mon Oct 21, 2002 1:44 pm
Location: Ireland
Contact:

Post by malCanDo »

The monkey head demo has been updated to specify polytopes, and to set the tickRate for the physics system.

http://www.candointeractive.com/blender ... Test.blend

Mal

malCanDo
Posts: 1
Joined: Mon Oct 21, 2002 1:44 pm
Location: Ireland
Contact:

Post by malCanDo »

OK, there's a whole new set of test scene for Blender, using the very latest Windows build ( from Testing Builds forum ).

Use the URL above to download it.
Mal

z3r0_d
Posts: 289
Joined: Wed Oct 16, 2002 2:38 am
Contact:

Post by z3r0_d »

malCanDo wrote:OK, there's a whole new set of test scene for Blender, using the very latest Windows build ( from Testing Builds forum ).

Use the URL above to download it.
Mal
looks like you forgot to pack the textures

also, the problem you point out has been there since non-sphere bounds were implemented

simply put, blender doesn't seem to do any good collision restution [shock propigation, lcp solvers, all sorts of ways to do this]...

I think you are complaining a bit much about this, could you try fixing it yourself? I'm sure kester would be glad for the help [and gameblender users would be as well]

in case you hadn't noticed, blender even has problems with a single cube on a plane. It's physics system has a long way to go before it is stable and flexible, like the newton dynamics engine, novodex, havok, ode, meqon, ....

I think asking it to be as good as any one of them quickly is a bit too much

[but, I'm not fixing it either, so what am I rambling about]

mpan3
Posts: 0
Joined: Wed Mar 24, 2004 7:16 pm

Post by mpan3 »

if you increase the "form factor" for the boxes, it makes the simulation more realistic and stable. :wink:

malCanDo
Posts: 1
Joined: Mon Oct 21, 2002 1:44 pm
Location: Ireland
Contact:

Post by malCanDo »

> looks like you forgot to pack the textures

DOH!!! It's done now, see the above link,

> I think you are complaining a bit much about this, could you try fixing it yourself? I'm sure kester would be glad for the help [and gameblender users would be as well]

:) I'm more of a content developer, rather than an engine coder. When I get time, I do intend to have a look at it ( could be 5 or 6 months though ).

I'm trying to be constructive with the time I do have, by creating simple sample scenes that a) illustrate the problem and b) can be used by the coders when fixing the problems.

> [but, I'm not fixing it either, so what am I rambling about]

;)


> if you increase the "form factor" for the boxes, it makes the simulation more realistic and stable.

I'll have a look into that, cheers...

Mal

Post Reply