Welcome to the introduction to blender physics.
So why use physics.
Well it simulates the real world we live in a physical world where things fall over they bounce off
of one another and we can use the physics engine in blender to simulate this.
Now you can manually place every bit of destroyed or deformed geometry if you wanted to.
And that's what this section is focussed on is the destruction and defamation of geometry.
However you can also use the physics engine to animator with.
So instead of animating a ball rolling down a surface or bouncing off of something you could use the
physics engine to do that for you.
Now it does enable you to create complex scenes easily and quickly so you can go down the route manually
placing things and having that exact control.
But if you were trying to simulate a wall falling over or perhaps some glass shattering you probably
don't want to do that manually because it would be an absolute pain to do so.
But if you fancy a challenge you can go half and through that I'm not going to because this is great
for realism.
As I've mentioned shattering glass falling towers you can even make some dominoes or something along
those lines with it.
Of course those things are quite complex so we're going to start with something simple.
We're going to focus initially on rigid body physics what's rigid body physics will as the name suggests
it simulates the physics of rigid or solid bodies.
So if you imagine just hard surfaces said chairs tables glasses etc. they all come under that solid
body.
Now this works very closely with the animation system as I've been alluding to it.
You can simulate a ball rolling down a hill or two objects bouncing off of one another and it works
in conjunction with the animation system rather seamlessly.
Some of the other physics simulations don't work so well with the animation system.
Now it's all move and rotate objects.
That's important so it was going to translate them and rotate them as they fall through the air or as
they break apart.
Now what it won't do is deform them.
Okay so now we've got that under our belts.
Let's go play with rigid body physics and hop on over in a blender.
Okay so over in blender and I'm going to do a couple of things.
I'm going to just save a default layout.
I'm going to keep it almost like the fault lay out when you first open blender.
However I'm going to set the end frame at 50 for the moment.
I've got a feeling I'm going to set this up several times so I'm literally going to save the starter
file as it is there.
Perfect.
So don't open up the tool shelf here and select my cube.
Now there are a couple of ways of adding a rigid body physics to a any mesh object in blender.
So there is a physics tab it's quite hard to redev when it's all squished up but it's just there and
want something selected.
We have two options to add active and add passive.
Now you can also do that on the properties window itself.
There's a little bouncy ball icon and we've got rigid body and when you click that's there.
By default you'll get an active object.
Now what does that do.
Well let's go ahead and press play now or use a shortcut.
Oh.
In a way we can see that it falls away.
And 50 frames seems to be a good loop point because it's disappeared from the screen.
Now if this was active it means that it is being controlled by the physics engine.
If it's passive It means it's not but will still interact with other Richard bodies.
So if we set this now to passive we can see it just sits there.
However if we put another cube into the scene.
Well let's do that.
Let's and Jube jubilate This cube.
And I'm just going to move up on the.
Z axis there and then move it across just a little on the X and make that want active.
Okay let's see what happens.
There we go it falls off into oblivion.
So that's quite useful and in fact here I'm looking a set that a little longer since now it's falling
for longer.
There we go.
So with 75 frames there we seem to get quite a fall animation we can see it disappearing.
So what are the other options.
Because in general it's great to just hit add active or add passive.
But in general we're going to want to have a bit more detail.
So over in the properties panel itself we've got some options now.
Active and passive are here animated is very useful because it enables us to use the animation system
a key the movements in and then let's blend of physics take over later on.
We won't do that at the moment but we can do that later on the mass.
Now the mass itself is pretty self-explanatory it's the weight of our object.
Now this is in kilograms and that is a was that's a two by two metre cube essentially weighing one kilograms
so it's going to act like a 1 kilogram two meter cube.
However if that weighed 10 kilos it would act slightly differently as you can see it's not sort of bouncing
off as far as it would do before.
And if we set that as a very lights one we can see it behaves differently as well so we can change the
mass of our objects.
Now one thing to bear in mind is if you haven't set the scale correctly.
So let's bring out the properties window here.
So we've got a scale here of 1 1 1 and on here of 1 1 1 which is absolutely fine.
However if we scale something up an unfit flies there.
If we scale something up like that we we see that it's going to act slightly differently.
In fact in this case because we scaled it and moved it whilst the physics engine was running it's not
like that at all so let's just put it slightly above.
So this is going to act differently because it's bigger but it will still act as if it was a smaller
cube.
So what we'd need to do in this case is make sure we apply with control a or go into object and apply
the actual scale and then it should be hafe like an appropriately sized cube that weighs 10 kilos that
can be very odd to get your head round at first but it does mean that the physics will act more realistically.
Of course if the desired result you want is a little bit unrealistic then you can do that so that's
absolutely fine.
Now rigid body collisions the next area down we've got a convex hull and the meshes self.
In general I wouldn't bother picking any of the others for the moment because it does change how things
behave.
So if I selected sphere this will act more like a ball.
And as you can see let's zoom in here so we can see it is actually intersecting and that's because instead
of using the outside faces of our mesh as basically where it's bumping into it's put a sphere inside
our model.
Now there may be reasons why you want that so either no to make a cube roll.
But so if we were doing that we could go down to the next area and go to collision margin put that on
and then increase it.
Now we set that top one and see what happens it will work.
It hasn't seemed to do much in this case.
I'm guessing it's still going inside the model.
Let's send it back to Convex Hull and let the simulation run and we can see there's a one blend the
unique gap.
It's literally hitting it a blender unit away.
So this can be useful.
I would not set it to zero.
But if you're having objects passing through one another the small small at that it was at before the
point 0 4 is usually more than enough to prevent it passing through.
Now friction is as we can gather is that how friction is the surface of that is.
So it was set down to zero it would have no friction and freely scoots across a lot of surfaces.
And if it was one it would really grip onto any surface it comes into contact with bounciness of course
is how bouncy an object is.
And we might not see in this particular simulation perhaps a ball bouncing on the ground would be a
better object bearer example of something as bouncy or indeed something that's got zero friction and
high bouncing us.
There we go.
We can see that was skipping over the surface really quickly and bouncing away.
Brilliant.
Okay.
So there's rigid body dynamics down here at the moment we won't go into that just at the moment.
But you can literally deactivate something until something else comes into contact with it.
If you wanted to and well since we're here let's do it anyway dampening.
Well we can dampen its movement or its rotation so we can say here that it's resistant to rotation.
Then when it hits Oh that is just really odd.
Was that what we intended.
Well maybe not let's turn it down a little.
So something is irritating a little too quickly after it's hit we can dampen that rotation and translation
is exactly the same.
At one you can see that well it's kind of like it's falling through goo rather than falling free.
Is she not getting through.
But if we lower that we can make the whole thing just a little bit more controlled rather than bouncing
all over the place.
So you can play with these to your heart's content of course to get some an effect or a simulation that
you desire.
And of course that is up to a challenge.
I would like you to go ahead and create a short physics simulation.
So create a simple scene using basic meshes gennari a physics simulation with some interactions so things
are hitting one and over and use both passive and active rigid bodies.
Pause video now and give That's a go.
Okay guys welcome back.
Let's go create a short physics simulation.
Okay so I've started off in a default scene here and I'm going to really icky but I don't want a cube.
I want a plane.
I'm going to scale up the plane.
Not pushing it through itself too about that and I'm going to tilt it so slightly down here so I'm going
to rotate on the x direction and then just do that.
So whatever lands on here should then slide down.
So let's go ahead and add something to land on it's going to add in a U.S. sphere and then we use it
as a ball and pop it in here and just see what happens.
Now of course we've not applied any physics yet so what do we need we need on here.
This is going to stay still so we need to add a rigid bullet to both of these.
And of course if we decide to play at the moment they both fall away.
So what I'm ONLY to do is make the ground itself passive.
And then the ball should hit the ground and roll.
Excellent.
Now looks like in this case we're going to need slightly more frame someone to go up to 200 here.
That should give us plenty to see what happens.
It should accelerate down here.
Perfect.
Okay.
So now that we've done that let's play with some of the settings and see what happens.
So both of these have a friction point five which is resistance to moving and about in this syrup.
So what happens if we set the ground with a bounciness of 1.
Extremes are a great way of testing things doesn't do anything.
Okay so what happens if we set both of them to a bounciness of 1.
I'm guessing it's going to bounce x.
So there we go there's a bouncing ball going down the hill.
Let's set this to zero.
And I'm guessing it won't bounce.
Okay so this is a great example of experimentation and working out the bounciness.
If both of one or more of the items have anything with zero in them especially the floor if you've got
more than one item then it's not going to really work.
However what this could both do for us is if we go back to the BE IN of the animation and let's say
let's go from a top few here and let's duplicate this a couple of times before it hit the right key.
So there we go.
So you got plenty there.
Now if they impact one out of it because they of course they won't impact each other down a straight
slope like that.
They'll just race one another into oblivion.
Bought we can do here is well let's subdivide our plane and give it some substance really under we go
for a simple subdivision and I'm going to apply that subdivision Locanda in edit mode.
There we go.
So now we've got something to play with.
I can pull up some geometry for it to for them to bounce off of.
Because they won't bounce off of it till we're actually in object mode.
Okay so we're letting them roll down and we can see that the bullet Oh things are falling through the
floor.
Let's just let it settle.
Let's redo the animation.
Well I wasn't expecting that.
I'm going to add modify and add.
A subdivision is surfacing just to smooth those out ever so slightly.
Let's see if that's made any difference.
Okay so these balls are now passing through the surface of our model.
Now that would suggest that it's not having time to calculate the impact that these balls are having
or literally they're passing through the surface.
I'll make sure that's let's say the mesh itself rather than a convex whole let's see if that makes a
difference.
This resets and plate.
Yes it does make a difference.
Now will these balls collide with one another kind of.
But they're not bouncing off of one of.
So let's give the ground a bit of bounciness and the balls will maybe be a bit more interesting.
And again this is one of these things that you can play with to your heart's content until you get it
how you want it to be.
Now the margin here might help if he probably does now that these aren't falling through.
That's one of the differences here.
The convects hole the coalition margin if it's not there allows them to fall through.
So I see examples of that actually work in action so we can move it's convex whole and we can see they're
hitting one another and they have got a bounciness of one.
Let's give them let's make them frictionless or make this one frictionless and see what happens.
So that's just sliding and pushing the other one down.
So because it's got no friction it's not rotating so we can add in a tiny bit of friction because that
ruins are a physics model.
So we've got to start from the beginning again and that's because some friction it should grip.
There we go and rotates.
I don't think I've got enough things that for it to bump into.
But by now you should have got the gist of your marble run or whatever you guys have created and do
remember to show your work in the discussions over the forum.
Love to see what you guys come up with some simple physics in blender.
And as always I will see you guys in the next lecture.