How to simulate a car crash in blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Applause] in this tutorial we are going to create this car crash scene in blender most of it is going to be driven by simulation but i'm going to show you a way you can tailor it to have your car doors fly open or just add any details that you want to the animation we're going to simulate the crash we're going to add some particles for the glass and finally we're gonna render out some smoke to tie it all together this tutorial is most suitable for you guys who already have some experience in blender but feel free to follow along and leave a comment if you get stuck on any of the steps so i can help you on the way let's not waste any time and dive straight into the tutorial alright so to actually get the car model that we are going to crash you can just download any free car model from the internet but i'm using this website called cd trader and you can just click cars here and hit this box so it's going to filter out everything so you only get the free ones and you can just choose whatever model that you like this method is going to work for pretty much all of these models but you want to make sure that you have something that is high poly enough so you can deform it and it will look realistic but you could use any website that you want or you could even model your own but i'm not that good at modeling so i'm gonna use some model from here okay guys so let's start with opening up a new blender scene then just select everything and delete and to actually import our car model that we got from the cg trader we want to go to file import and then select whatever file extension that we had on our model so in my case that's obj so i'm just going to select that and find my 3d model just double click that and then we can hit s to scale it down and orient it correctly then we want to add in a plane to act as our ground for the collision so we just want to make that pretty big so we have some some margin then we can hit ctrl a and apply the scale then before we do anything else we want to make sure that the car has a bit less geometry so it will be faster to work with when we do all these kinds of simulations and stuff so we want to select it go to modifier tab and give it a decimate modifier we can select a value of maybe 0.5 and it will half the amount of triangles it has and as you can see it still keeps its original shape but we have a a little bit less geometry to work with so let's just apply that using control a all right now let's create the actual deformation object that will drive the deformation when it crashes so just duplicate this car and hide the original one and then name it something like deform and don't forget to apply the scale then give it a remesh modifier and turn it to something like 0.5 so this will create this really simplified shape maybe 0.6 and just apply that using ctrl a now we can parent this original object to our new deform object so just select the original then select a new one and hit ctrl p and select parent to object so now now that we move around this object the original is going to follow so we can just move this back a bit and hit i to add in a keyframe for the location and grab it forward then give it a new location keyframe to give it some linear interpolation you can just hover the mouse over here hit t and choose linear now you can see it kind of drives forward that's a bit too fast in my opinion so i'm just going to move this keyframe to frame 40 and that is automatically gonna make it a bit slower so yeah that's perfect now let's hide the original one and just work on the deformation in the crash so we want to select this one and go to its physics properties and give it a soft body and as you can see when we simulate this it is going to try to follow the animation but it's kind of weird so we want to make sure that before the collision happens it follows the keyframes 100 and then at the frame of the collision we want to make it so that it goes com completely simulated so to do that we want to go to goal right here strength and go to frame 40. sorry frame 39 make sure that these both are at one then give those a keyframe move to frame 40 and turn them both to zero and then keyframe them both and as you can see this will kind of make it so that it starts simulating at frame 40 and just flies away for now but we want it to actually collide with this plane here so we want to give that one a collision modifier and if we play now we will see that it actually collides with the ground but now it just kind of sacks together like this and we want it to have more like a metal material and we can get that effect by changing the edges right here under the soft body so increase the pull and push to 0.99 turn the plasticity up to 100 the bending up to max as well and you will see that it acts much more like a metal material but of course it's gonna look a bit weird because now it doesn't really collide with anything so let's add in a simple cube go to frame 40 and move it so that it will collide with it at frame 40. just put it right here and then give it a collision modifier and here you can just play around with placing it differently so maybe if you place it here it will give one effect and if you place it more in the middle or maybe bring it down a bit it will give it another effect so you can kind of play around with that until you get something that you really like so i'm pretty happy with the result right here but i want it to have a bit more like upward force uh as soon as it hits here so i'm actually gonna add in a force field that will push up the back of the car at the moment of impact so you can do that by just going in to add a force field and you can keyframe the strength to give it a little push upwards right where you want it to and once you think that looks good you can actually bake the simulation so go to cash and just hit bake right here right so once it was done baking this is what i got and i think that looks great so i'm going to go ahead and parent the high poly mesh to this low poly deformation object so just select the high poly mesh and give it a surface deform modifier and then we can select the form and let's go to frame one and hit bind and if we hide the deform object we can see that the high poly mesh follows and also when the deformation is taking place you'll see that the deformation is applied to the high poly mesh as well so that is looking really nice to add some more detail to the deformation we can make it so that this part right here and maybe one door kind of flare out and deform on their own so to do that we want to go to frame one and go to edit mode and just select everything that we wanna separate and animate by itself so you can just select the the faces right here and hit ctrl plus on your numpad to expand the selection like this and you'll see that we have selected only this part right here then hit p and separate by selection and then go back into edit mode but on this part right here select the vertical that is close to the rotation pivot point shift s and then choose cursor to selected go to object set origin origin to 3d cursor now we can see that we have the origin right here to parent it we can hide the high poly mesh and bring back the deform one go to edit mode and select some verticals right here so just select three and then shift select the deform hit control p and parent to vertex triangle and since we moved it this it gets kind of weird so just grab it and manually move it back into place you'll see that when we play it has parented to that actual part of the mesh and it's going to flare out a bit okay so now we want to add some shape keys to actually deform this object right here so go to object data properties and add in a base shape key and a new one give this a value of 1 then go to edit mode and now we can start to edit the actual deformed shape of this object so hit o to enable proportional editing you can see you have all these different options that you can use to give it a deformed look [Music] and another way to give it a bit more randomness is to use the random selection right here and you'll see what kind of effect that gives so it just moves the verticals uh randomly like this so let's see i think that looks fine and you can see how the animation is going to look if you just turn this value up and down like this so now we want to go to frame 40 where the collision is taking place so on frame 41 it is going to be a value of zero then on frame 42 we want to give it a value of one go to object animation big action select all of these boxes right here and just hit ok so this is going to bake the animation to actual keyframes that we can smooth out so just grab the corner right here and bring it up a new window make it a graph editor select everything and just hit alt o one time and if we bring back the high poly mesh and rebind this modifier so just hit unbind and bind again because we made changes to the mesh you can see what kind of effect we have so far i'm just gonna do this exact same process for one of the doors now all right so now that we're done with the door this is what we got and i think it's a pretty decent start but of course we gotta make it so that the windows explode into thousands of glass shards so to do that we can tab into edit mode and select all of these glass pieces using its material right here so just select the glass material and hit select and it will automatically select everything like this and then hit p to separate by selection let's give it a subdivision surface for it to have some more geometry that can explode now we can jump straight to frame 41 where the collision is taking place and hit object quick effect and then select quick explode we're not going to change too much here but we want to make it so that the number of particles is way bigger i'm going to go for something like 5000 you can see now we have loads of particles and if we make the deform object an actual collision object that will push all the all the particles with the collision and when it tumbles they will kind of follow and the bounce of the car so just add in a collision modifier right here let's see how that looks [Music] i'm just going to increase the lifetime as well to be frames so that they won't despawn in the middle of the animation and then we can go to cache and just hit bake right here okay so i got a little problem because i accidentally hit delete all bakes on the soft body simulation so i just had to redo that but now that that is done this is what we got so you can see that we have some deformation on the car we have these parts that hang loose and we have some glass that shatters as well the only thing that's missing right now is some smoke to bring it all together so to do that we want to create a new cube which is going to be our smoke domain and scale it up to fit the trajectory of the car right now we can set this one to fluid domain and just keep it on gas to add an emitter we can use a sphere scale it down a bit and parent it to the front of the vehicle we can use the same parenting technique that we did before so parenting to the vertices to make this sphere actually emit smoke we want to give it a fluid and set it to flow keep it on smoke and make it inflow on the flow behavior if we increase a resolution of the smoke domain and play it we can see that we have some smoke but we want to increase the resolution a bit more maybe 200 and also give this object a fluid set it to effector and keep the effector type as collision this is going to make it so that the smoke kind of forms around the car and i noticed that we need to increase our resolution a bit more so 265 should be fine we can also set the cache frame start to 43 set the cache type from replay to modular check is resumable then just hit bake data right here now to give it some more details we can enable noise right here and just hit bake noise so once i was done baking i realized that i wanted a bit more subdivisions so i increased it to 300 and then baked it one more time here and then baked noise as well and what we're left with is is this scene right here and all we need to do now is just fix the materials and then add in a hdri and render that [Applause] thank you guys for watching if you have any questions or want to suggest a future tutorial feel free to leave it as a comment down below i read and try to answer all of them from now on i'm gonna upload a tutorial video like this every week so if you don't want to miss that feel free to subscribe and i'll see you guys in the next one [Music] you
Info
Channel: FxForge
Views: 106,239
Rating: undefined out of 5
Keywords:
Id: xxtHq2LD-Ic
Channel Id: undefined
Length: 16min 26sec (986 seconds)
Published: Sun May 08 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.