PDA

View Full Version : Bullet Physics / Dynamics probelm - items passing through the ground slowly....



starbase1
11-09-2013, 04:19 AM
This one I am having problems with, and I'd really appreciate any ideas on how to fix it.

Animation of coins showering down on YouTube here:
http://www.youtube.com/watch?v=cNJueNgHSpc

The idea is to get a cascade of coins. But they are passing through the ground.

I've increased the number of dynamics frames per second a LOT, (see attached images), but I don't think this is the answer, because the coins seem to penetrate the ground more the slower they get, (plus the calculation time is now up at about 20 minutes).

I have collision distance increased up to 20mm from 0, all objects. Coins are about 150mm thick, and 2m diameter. As you can see in the screen shot, I have divided the ground plane until polygons are smaller than the coins.

I include the scene files if anyone else wants to play, (ignore the missing image file please)

Has anyone got any ideas on other parameters I can change?
Nick

118071118072118073

pinkmouse
11-09-2013, 05:19 AM
Downloading the scene now to have a play, but for a start, just as there are no infinitely thin, rigid collision objects in real life, there shouldn't be in LW, so give your groundplane some thickness.

starbase1
11-09-2013, 05:27 AM
How do you mean, and at what scale?

Is there a way to thicken the dynamics interaction?
The problem I have when thinking about it is that if I add a second polygon layer, by using a thin box, and it slides gently through the top surface, if the second layer catches it then it will slide around partly under the first and look seriously weird...

I can see exactly how that approach helps when things are moving rapidly, and at a less acute angle of collision, (similarly with upping the frame rate), but this is one object sliding along the surface of another,and I think that is at the root of the calculation errors....
Nick

pinkmouse
11-09-2013, 05:37 AM
Right, just got it up and running after a few errors in loading, and the first thing I see is that you have two many coins for the testing stage. Until you have all the dynamics working as expected, then to cut down calculation time use less coins, (you can also cut down the animation time, I've knocked it down to 600 frames). The first thing I did was to delete half the ones you had. Once everything is working to plan, then you can crank it up.

Here's what I've done so far without changing your Bullet setup yet.

starbase1
11-09-2013, 05:42 AM
Thanks for your help! It's very much appreciated.

I was also thinking more about what I wrote - I'm doing some experiments based on adding some jitter to the ground plane points, so it's not going to give perfectly parallel polygons so easily. Also increasing friction and bounce a bit.

pinkmouse
11-09-2013, 06:23 AM
Right, started from scratch with Bullet settings as yours were confusing me, here's the scene. Video will arrive once youtube has done its stuff.

edit: here's the video. Looking nice apart from one really huge bounce. :)


http://www.youtube.com/watch?v=Jxv1TYALInY&feature=youtu.be

starbase1
11-09-2013, 06:55 AM
Oooh, that looks promising! I'll pick it apart later this afternoon, got to get some shopping done now.

My idea about adding jotter to the collision planes didn't help at all...
Nick

starbase1
11-09-2013, 09:42 AM
OK, I tried your scene, and while it looks OK to start with, if you run it through longer it has the same problems mine did:

http://www.youtube.com/watch?v=995wHx_k1Zk&feature=youtu.be

I also attach a still for those who don't want to watch the whole video...

There are coins stuck part way through the ground, coins that cone to rest above the ground, and coins that slide along at a constant tilt.

Thanks for your help so far - any other ideas?
Nick

bobakabob
11-09-2013, 12:42 PM
Not at LW right now but there's a control to adjust the point of contact parameter (can't remember what it's called) so it's worth messing with that.

Also check the dimensions of your objects - aim to keep keep approximately 'real world' - if they're too big or too small Bullet doesn't work too well. Worth trying different variations if there's still a problem.

For the mad coin issue, check the friction settings. Good luck and keep posting :)

XswampyX
11-09-2013, 12:51 PM
Here's Pinkmouses amended scene. You will want to try and use the inbuilt bullet shapes instead of mesh (if you can), these are a lot more 'solid'.

I've removed some of the angle coins and replaced them so I can use the cylinder shape, the floor is now a box shape not the mesh shape and the same with the ramp/slope. It's just a box rotated and moved in layout.

Oh, I have also UV'd the coins, It's better to do some surfacing first if you are going to clone 1000's of them.

Have a look, it's rock solid! :)

starbase1
11-09-2013, 01:15 PM
Thanks guys - much appreciated.

Bob, I'm not sure what you are getting at? If you work out where that button is I'd be grateful!!

Swampy, that sounds great! I look forward to giving it a go. I don't understand collision shapes at all - in most cases I'd have thought you'd get irregular shapes, particularly using fracture...
I was subdividing the ground object following advice in a very brief YouTube tutorial.

Are there any detailed tutorials out there, (including paid for ones). I'm impressed with the best stuff I have seen, but I'm struggling to understand why controls work the way they do, and what the underlying principles are.

Nick

bobakabob
11-09-2013, 01:32 PM
Nick, I meant Collision margin - I have this set to 5mm and it works well but worth adjusting.

Have you tried messing with Friction, Bounciness settings?

XswampyX
11-09-2013, 02:40 PM
Thanks guys - much appreciated.

Bob, I'm not sure what you are getting at? If you work out where that button is I'd be grateful!!

Swampy, that sounds great! I look forward to giving it a go. I don't understand collision shapes at all - in most cases I'd have thought you'd get irregular shapes, particularly using fracture...
I was subdividing the ground object following advice in a very brief YouTube tutorial.

Are there any detailed tutorials out there, (including paid for ones). I'm impressed with the best stuff I have seen, but I'm struggling to understand why controls work the way they do, and what the underlying principles are.

Nick

Have a look at the manual :- bullet.googlecode.com/svn/trunk/Bullet_User_Manual.pdf

It lists a lot of things that aren't available (yet?), try page 38 onwards.....

The basic mesh shapes sphere, box, cylinder & capsule are more of a maths based solution as opposed to the mesh based ones. It seems to make them more accurate and stable. No good for a fractured object, but you could use the box on the floor and make the simulation better/less jittery.

Cheers.

pinkmouse
11-09-2013, 03:45 PM
Ta for picking up the baton, XSX, had to go do family stuff. :)

starbase1
11-10-2013, 02:31 AM
Now working perfectly!

http://www.youtube.com/watch?v=4UNOEvRViAw

Thanks Swampy - I'll probably have another pass at it with better bitcoin surfacing

VermilionCat
11-10-2013, 05:30 AM
swampy, the manual is very informative and your results are excellent! Thanks!

XswampyX
11-10-2013, 04:24 PM
Thanks Guys, glad to have helped. :D

Here it is rendered with Octane. Looks cool if you play some music in the background.


http://youtu.be/kINuLoNHC5Q

Not a jitter insight.

starbase1
11-12-2013, 02:32 PM
Just to round things off - I managed a pair of collapsing Jenga style towers, with no errors I can spot...

http://www.youtube.com/watch?v=Fopr4K413zE

I've attached the scene files for anyone who wants to play - there are three cameras to give the 3 different vies used in the video.

Thanks to those who steered me in the right direction.

Nick