Waving Flag In Blender | How To Create A Flag With Cloth Physics & Force Field Simulation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial we will learn how to create a waving flag animation which is attached to a moving object like a boat or a ship we'll make use of cloth physics in blender to create this and it is quite easy so let us start with a blank new scene we will first hide this default cube now go to the add menu and add a plane we need to make it upright so change this x rotation angle to 90 degrees and let us move it up maybe by 4 units we will convert this into a flag so we need to change its length according to the dimensions of the flag design that we intend to use let us scale it up by 2 in the x dimension then in the object menu apply the rotation and the scale factors now go to the modifiers tab and add a subdivision surface modifier switch over to the simple option and change these levels to four or five on both the places now apply this modifier and as a result of this we will get enough number of subdivisions for this plane which is very important now we want to pin this flag at these two points so let us go to the edit mode deselect everything and select these two endpoints now go to this object data properties tab create a new vertex group and click on assign so that this vertex group contains these two endpoints now go back to the object mode then go to the physics tab and enable the cloth physics we will go with all the default options but we have to make two changes first under the shape section we can see a field called pin group here we have to select the vertex group that we have just created and under collisions section we have to also enable this self collisions if we now play the animation we'll see that the cloth falls down but it has got an uneven or a rough surface so we need to add some smoothness to this cloth let us go to the modifiers tab and add another subdivision surface modifier we have to use the catmo plark option with a level of say two and we can also enable the shade smooth option if we again run the simulation we'll see that the cloth is now quite smooth but we want this cloth or this flag to wave in the air in a horizontal fashion this way instead of falling down so we need to add some force field in our scene maybe a wind force which will enable the flag to wave in this direction let us stop this animation and then from the add menu we'll add a force field maybe of wind type we need to rotate this field correctly so that the wind flows in this direction so we have to change this y rotation angle to 90 degrees and we can also reposition this field just behind the flag it does not actually matter because by default a wind force will affect the entire scene but we need to increase the strength of this field sufficiently so go to the physics tab we have to ensure that this shape is plane and we have to enter a high value in this strength field something above 5000 now if we run it again the flag will fall down initially due to gravity but then the airflow will force it upward and it will start waving in the air just like how a flag should behave ideally let us now add a stick or a hoist right here and we can also add a suitable texture for our flag first stop the animation and then go to the add menu and add a cylinder we need to reduce its diameter to make it thin so let us change these two factors to .05 and enlarge its height by a factor of three we need to then move the stick to this position so let us move it up like this we can directly enter a value of 2 here and we need to also move it toward left so that it matches with the flag end we will now add a texture for our flag so switch over to the rendered view mode and enable the hdri lighting as well now go to the materials tab and create a new material here in this base color we have to select image texture then click on open now select the picture that you want to apply to your flag if we run the simulation once again it will look fantastic and it remains attached to the stick but please remember one thing if you simply enable the hdri lighting from here it won't take effect when you render the scene you have to set up the world environment suitably using an environment texture which we have discussed separately in another tutorial the link is given below in the video description we also want the flag to be hooked to the stick because the stick should be able to move to any other location and we want the flag to follow the stick wherever it goes so let us go to the first frame now select the flag and go to the modifiers tab we have to add a modifier called hook modifier and it should go to the very first position so this sequence is very important first we should have the hook modifier and then the cloth modifier this cloth modifier is automatically added by blender because we have enabled the cloth physics and all other modifiers for the smoothness of the cloth should go to the end of the stack if this sequence is not maintained it won't work correctly now for this hook modifier in the target object we have to select the stick or the cylinder and in the vertex group we need to select the same vertex group that has got these two points of the flag now we can either add some keyframes and move this stick manually or we can attach it to another object which will move here maybe like a ship so let us bring back our default cube and we can hide the force field let this cube play the role of a ship in this example we need to attach it to the stick so let us move a little bit toward left like this now select the stick press the shift key and select the cube together then press control p to bring this menu and select the object option so the stick will now become a child object of this cube and it will move along with the cube wherever the cube or the ship goes to we will take our ship to somewhere here so we need to keyframe its current x location then go to the end of the animation let us move the cube toward left and we need to keyframe this as well now go to the first frame we need to bake the cloth physics for the changes to take effect so go to the physics tab and scroll down expand this cache section delete the existing cache files and then start the baking process once the baking is done we can verify the final result so the cube is now moving and the flag is moving along with the cube while waving in the air as expected and later you can also replace this cube with a ship to get the same result as we saw in the demo so this is how we can create a waving flag with a moving object i hope you like this tutorial thanks for watching and don't forget to subscribe to this channel
Info
Channel: 5 Minutes Blender
Views: 22,898
Rating: undefined out of 5
Keywords: Blender 3.2, Blender 3.1, Blender 3.0, Blender Tutorial, How to use blender, Blender basics, Blender tutorial for beginners
Id: fX_87v7SA9k
Channel Id: undefined
Length: 6min 54sec (414 seconds)
Published: Wed Sep 14 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.