Welcome to the centre of mass.
So where is the centre of mass and what is it.
Well it is where ever the origin is.
Blender uses the origin as the centre of mass.
Now that means you have control over all over this which isn't always a good thing.
If you've inadvertently constructed something away from the genome bit from the origin itself that geometry
is going to act very weird.
When you start applying physics to it so it can lead to some strange results.
Now they might be desirable depending on the type of thing that you're doing.
Now blender can calculate for us the centre of the mass and you've probably seen this before when we
move the origin to the centre of mass.
Now in most object that's going to pretty much put it in the middle unless you've got a lopsided object
in which case you'd want to adjust the centre of mass so it behaved realistically when it comes to physics.
Now let's go ahead and hop on over into blender and play with the Centre of Mass.
Hey so welcome over into blender.
Now at this point we're going to focus on something very similar to the wall you saw that the tank was
breaking through earlier.
But we're going to build it up from scratch.
So in order to do that we're going to use a raise.
So my first mini challenge for you is to pause a video and go ahead and make a wall.
This isn't going to be one of those major challenges but this is a mini mini challenge.
Challenge yourself to build a wall made of standard size bricks if you will or a pretty standard ratio
of bricks you don't have to worry too much about the size at the moment.
So go ahead pause video now and give that a quick go.
Okay now did you give that challenge a go.
It's very important to practice your skills.
Now I'm going to go ahead and I'm going to build up my wall super quick here.
I'm literally going to scale in the y direction my break by half and scale it's in the z direction by
half.
I'm going to go to the control not the control panel sorry the Properties window for the 3D editor and
shift it up by point five.
So I've got my brick here.
Finally I'm going to apply scale now because we're working with physics.
It's good if things are the right size from the beginning.
Now I'm going to shift this across a little over here and I'm going to add a ground plane in and whilst
I'm at it.
And you might not have done this because I didn't ask you to create a black a ground plane that's absolutely
fine you can pop one in now is your following along.
I've added a ground plane I'm going to make sure I start saving my work and can as save as wall because
we're going to start applying physics and physics can crash blender occasionally.
Now whilst I've actually got selected I'm going to go ahead and apply the scale that I've just bumped
that floor up to four and whilst I'm here I'm also going to apply a rigid body and make it passive because
the wall needs somewhere to stand.
Now with the array itself I'm going to use 10 bricks and then build it up from there.
So let's go ahead and add an array and if I'm happy with how it looks let's go to 10 of them.
Okay let's shift over here a little so it's more in the middle.
Excellent I'm happy with that.
Apart from the gap in between I'm going to go for one point one nine bit big so I'm going to go for
one point not five.
That looks much better.
Okay so that's my first array am now going to a race a race so relative offset I'm going to say that's
a zero for the moment and says Z to one and I'm going to just going to zoom in here so I can see the
relative gaps now because my brick is half as high as it is wide.
I should imagine that the relative offset here if we said it's a point 0 5 like the other one we are
going to end up with a gap that's half the size which has happened so by go one point one.
We've then got a nice gap between here let's say for the mortar or anything along those lines.
And it's a good idea to keep an idea.
Or it's certainly an eye on these numbers that we've used because we're going to use them in a bit for
the margins for physics.
Okay so now I have done that I just need the offset in the x direction by wellpoint one would be one
brick because there are 10 bricks so I won half a point once again open in 0 5.
Okay so that's the first stage and the second stage of the wall down and now it should be a matter of
just offsetting in the z direction going up.
Now that is too big.
So that again that's point nor a one point not 5.
Excellent.
In fact if we go to prospective mode we can see it from the side and that looks even which is nice.
So orthographic MO go from perspective mode and we can use a couple and make it super high.
We wanted so that's fine with me.
In fact we could link this together and build a building but I'm going to leave it as a wall for the
moment.
Now looking at that the ground is far too small some deerskin to scale it up a little bit more and apply
that scale.
Okay so now we've got this wall on this ground.
We've got a basis to work from there.
If I go ahead and apply physics to this whole wall you probably guessed the ball was going to move as
one object with its centre of mass.
Interestingly enough all the way over here so that's not where the centre of mass of this would be at
all it would be somewhere in the middle of the wall.
And if we go ahead and run the physics engine it just wobbles because already sat on the ground.
If we were to just let's say for argument's sake lift the wall up so it was up here and then dropped
it onto the ground rules see that again you saw there it twinged or twinged around that centre there
so that's wrong.
That's just wrong.
It's not going to work like that in real life.
So we need to separate out all these bricks.
Now it is important at this point to remove the physics from the break itself.
Otherwise when you try and move the origin and stop that from bouncing around if you try when we go
to if we scroll down here and set the origin to the centre of mass Well it's not going to work is all
based around here.
And of course at the moment we still got all the array modifiers UN applied.
Now remember to turn this off some going to do that now.
And I'm also going to save my work that is always important.
If I use the right shortcut keys ever get up save my work and I'm ready to do a challenge.
But before we get on to that challenge I just want to run through with you really quickly a small change
that's happened since this video's been recorded.
Has it jumped forward now to two point seven.
This is the end state of what you'll be going for.
And of course when we go ahead and set the origin we have a few different options.
We've got set the origin to the centre of mass by the surface or by the volume.
Now in general unless you've got a reason to do so I would recommend using the volume itself.
So there we go.
And in this case because they are cuboid us it's going to be the same no matter which one you pick anyway.
But just to say there's two separate options there.
In general I would pick volume unless you've got a reason to pick surface.
Now here comes your challenge.
I would like you to go ahead and create a physically stable wall so.
So basically one doesn't fall over or explode on us one not yet anyway.
So all bricks should be individual so they can be acted upon individually.
Now move the centre of mass for each brick to the right location at the moment is all focussed around
that original brick and that's going to end well that's going to cause some interesting results and
we'll certainly throw the bricks around something crazy.
If he had chaske leave it where it is you might want to just try where it is currently.
Just to see the effects.
If you want to take it so they should rest on some invisible mortar or gap that matches the existing
gap.
So when you add the rigid body to the actual bricks themselves remember to include a margin so that
the bricks essentially float on top of one another.
But that is to imitate more to being in between them so they're slightly separated.
Now make all the bricks have the same physical properties.
And remember you can do that in one fell swoop rather than doing it individually.
If you start playing about with bricks and given them slightly different properties that's fine.
That could add to the realism of a scene but it be good to have a starting point where they're all identical.
There may be some instances where you'd want to change that but not in this case.
So go ahead post a video now and give that a go.
Okay guys welcome back.
Let's go ahead and create a physically stable wall.
Okay so we left off over here with our wall as individual items.
Now I'm going to go ahead straightaway and hop into edit mode.
And of course we've got all of these bricks.
Well no actually we can't do that.
I'm getting ahead of myself.
You see because they aren't individual bricks.
They're in a ray at the moment all silly me.
I'm applying my array in the wrong order so apply from the bottom up.
We go and the final array.
Okay so now when we go into edit mode there we go we've got all individual bricks now let's go ahead
and separate them by loose parts because they're not connected anywhere at all.
We can just literally separate them apart.
Now that we've done that we can well literally apply physics to them.
So in order to do that there are a couple of things that I'm going to do to make my life easier so I
can select them all every time is I'm going to turn off selection for the camera and I'm going to turn
off selection for these these items here just in case I managed to select them.
The lamp as well and the playing I don't want to be selecting the floor and changing its properties.
Now whenever I select all I should be selecting in object mode I'll be selecting only these mesh objects
themselves and nothing else.
Literally nothing else in the sinkers and nothing else selectable ho case.
Now we've done that we've got all of these bricks selected and an active selected brick.
So the one that's active is the one that's going to take on the rigid body and it was actually the furthest
one away from here so if we go ahead and well basically play that.
We will see once the it starts it falls down and does something weird when it hits the floor.
It does something weird it gets dragged along because its centre of gravity is actually passing beneath
the plane itself so it's actually being pulled in line with it.
I think we're going to need some more frames.
Anyway I'm going to go up to one hundred fifty so you can see here.
He gets pulled in so it's directly above that and then scoots around the surface so it's worthwhile
knowing that that centre of gravity will be funny when we apply it to the rest of this.
And let's do that.
It's all going to be sucked into this one place here.
So good to go to the physics tab and copy from active.
And will we do that the whole thing boils down and all gets sucked into one place.
Yay.
That might be here a.
Awesome effective a portal opened up and you wanted it to be pulled into one place.
Well that isn't what I want to happen here.
I want them to be individual.
So in order to do that I'm actually well kind of stuck here because I've just applied physics to everything
and I can't unsupplied physics to everything without undoing so I am just going to undo.
In this case another case in point for saving is that you don't want to end up doing a ton of work and
then having it ruined or stop the playback for the moment and reset it to zero.
And now I'm going to remove the rigid body from that can select everything again and then whilst we're
in object mode and it gives the tool shelf and I'm going to set the origins of the centre of mass now
because there are now separate objects and it's got no physics applied.
There you go.
Everything's now got its own centre of mass.
Let's add a rigid body to the active one and then go into the physics tab copy from the active one to
everything else.
And of course hit play says go ahead and hit the right keys.
Now well that's actually dropping from quite a height.
We did play with that earlier.
So let's set that back down to zero.
Does that make a difference.
No.
No of course it doesn't.
So let's move everything back down here.
Case looking at this.
What have we move moved with just moved this one down.
So that's Paul.
I don't know where it was before some was going to have to undo to that's in the right place.
Okay so everything there is at the beginning of the scene and now removing the whole block as a whole.
That looks like it's now on the surface again.
That's what whilst were in orthographic maybe can confirm that.
Perfect and let's run the physics simulation.
Now the moment the bricks drop on top of one another which is fine but we need to leave a gap for mortar.
Now we remember earlier we had a margin something to enable collision collision margin and I'm going
to set it to nought point five.
I think that was what we had before and well Convex Hull is not working so I'm going to try mesh K mesh
isn't working quite as I expected to either stop the physics simulation here and rewind and just see
if that makes difference.
K It is not making a difference which is surprising.
I thought it would have done up the margin now to 1 hour you know whats happening.
Tony forgot to apply from the active side to copy from active.
So going down that point.
Well let's actually be funny.
Let's set it a point five and I'm going to hit copy from active.
Boom.
The bricks are literally so confined together that they literally explode.
Now that's not the faked we're going for although it is quite interesting so let's try.
Nope.
The point oh five again.
And then copy from active that's important and how it's not being crazy anymore.
Let's go around to the front again and zoom in.
That is that gap right.
It is.
And you could see they're kind of jostling and floating on top of one another almost as if there was
a magnetic field around them.
That's a bump that up to 150 again.
And this brick is toppling away.
Oh.
Well hey the whole thing falls over eventually.
So it's not inherently stable at that point.
But we can tweak the physics settings in the bit to improve that.
Okay so after a few minutes of confusion the wall just kept falling down and I thought well hang on
a minute all my trial runs that I've done this has not happened so.
But the other thing I did do is make the wall explode violently.
So perhaps something ahead crashed.
I remembered some of the physics of a splosion and was toppling for some reason.
Now I don't understand why it would do that.
But it turned out that going down to the shape itself and switching it from mesh to Convex Hull I thought
at first.
Okay.
I just picked the wrong colation shape.
But when switching it directly back to mesh again well what happened.
Well it was still working okay so this is a case in point that sometimes the physics can get a little
bit confused.
So switching the collisions shape can almost reset the physics engine itself and do some recalculations.
And literally after switching between those two it started working again.
One of the things you can do when this thing is moving is if I grab a brick and move it.
Well it really starts throwing things about course it resets.
So after sorting that out.
That seems to have fixed everything.
The other thing of course that we need to sort of figure out at this point and we can have a look at
this brick that's tumbling is does it look like a break when it hits the ground.
Is it too bouncy.
Not particularly bouncy but it does slide a little.
So let's go ahead and sort that out so I'm going to go ahead and select everything again.
And we need an active Brecken let's use the one that's falling.
So select everything after selecting the active one.
And let's go ahead and have a look at physics properties.
So it's got strong friction.
And if we set the bouncing to one as we've discovered before it's a combination of both.
The floor itself the floors properties.
And this here we discover that in the last lecture.
So we don't want any bounciness because bricks don't bounce.
I'm going to up this number again.
The resistance to translation and a little bit of resistance to rotation see if that makes the break
just a little more.
Yeah that looks a bit better.
And of course up here the mass of the brick.
Now these bricks are quite large.
They're not to scale.
That's certainly the fact there are whole metre long.
She's huge.
That brick is not going to weigh one kilogram.
It's going to weigh significantly more so let's say it weighs 10 kilos.
And let's see how it tumbles from the wall at this point of course is going to do more damage as it
does.
But that feels like that brick now has more substance to it.
So of course that's actually apply that to all the rest of the bricks as well.
And they should now be inherently more stable anyway because they're a bit heavy for their size.
If we set Well let's do it let's set the mast to point one so we've got a 10 Gramp now 100 gram break
and then copy from Active's of the whole wall is like this.
It it's not going to come to a complete stop when it lands.
In fact if we make it even smaller you see it doesn't even affect bricks at this point.
So that set back up to 10.
Now here's a good example because those bricks don't weigh anything anymore.
They were 100 grams and this weighs ten thousand grams.
You can see the effect it's having on the wall it's actually shifting the entire lot sideways as it
falls because it's so much heavier than the rest of the water.
Now of course at this point I'm going to copy from active again to the whole wall and now you have to
wait for the physics engine to reset of course go back to the beginning and there we go.
There's the one brick tumbling to oblivion because it's got no support.
Excellent.
So how did you guys get on did you manage create a wall that was stable.
Do you have any problems like I came across and have to troubleshoot.
Please share your falling walls in the discussions and I will see you guys in the next lecture.