blenderNetwork patreon blender-logos d heart user th book photo pencil map-marker chevron-right comment comments twitter facebook rss chain navicon google-plus envelope linkedin calendar-o tumblr reddit stumbleupon share-alt blogger flattr flag

Animate a Billowing Flag

Blender 3d tutorial

Billowing Flag

To create a billowing flag in Blender 3D, we will go over how to properly model a flag, use Blender's cloth and wind physics to simulate realistic flag movement, and finish off by using material nodes in Cycles to create the final render.

Flag Dimensions

The flag itself is simply a plane. So, open up Blender and remove the default cube. Add a plane to the scene (Shift-A, Mesh, Plane). Then resize the plane so it has the correct dimensions of the flag you are creating. I am creating the American flag, so I'm scaling along the X axis by 1.9.

You can find and determine the ratio with which to scale your flag at Flag Spot. Simply find your flag and divide the width of your flag by the height (width / height). Take that value, go into Edit Mode and scale (Press S) your plane on the X-Axis by that value.

Flag Positioning

The next step is simply rotating the flag so it is upright in our scene. This is done by selecting our flag and rotating along the X-Axis by 90 degrees (R, X, 90).

After your flag has the correct positioning, make sure you are in edit mode and subdivide the plane. I used a setting of 10 cuts. These subdivisions will allow the flag to flex and bend when we attach cloth physics to it. If you would like your plane to be more detailed, feel free to add more subdivisions to your flag.

Cloth Physics

Since we don't want a stiff flag, we need to tell Blender to simulate cloth with our plane. We do this by going into the Physics panel and clicking on the Cloth button. To keep things simple, I decided to use the 'Cotton' preset and only changed the Quality setting. I made steps a value of 16.

Also, in the Cloth collision setting, I changed the Quality to 8 and checked the Self Collision box. This ensures that our flag will no go through itself when we animate it.

If you play the animation in object mode now, you should see the flag fall off the screen. We will be fixing this problem in the next steps.

The Flag Pole

Our flag falls straight down because we do not have anything acting as a flag pole to hold it up. While we will not be modeling a flag pole, we will instead simulate it with a vertex group. To do so, go into the Object Data panel and find the Vertex Groups section.

Now add a vertex group by pressing the plus button, rename the group to Flag Pole, and go into Edit Mode by pressing Tab.

Next, select the vertices that will act as the flag pole, as shown in this image, and click the Assign button to put those vertices into the Flag Pole group.

Pinning the Flag

Testing the animation now will again result in a stiff falling flag. To finally fix this, we need to head back to the Physics panel and into the Cloth section and check the box marked Pinning. Then click on the text box directly below and choose our Flag Pole vertex group.

If you play our animation now, you should see the one side of your flag stay in place and the rest of the flag fall in a cloth-like manner.

Creating Wind

To create a wind object, add an empty to the scene. Go into the Physics settings, click on the Force Fields button, and in the Type drop down, select Wind. The only other setting to change is the Strength setting. I gave this a setting of 150.000, which will look like a fairly strong breeze. Of course, you can do differently.

At this point, we have a basic wind object, now we need to aim it. Select the wind object and rotate (Press R) it on the Y-Axis by 90 degrees. If you test it now, keep in mind it will take a bit for the flag to pick up the wind, other than that, you should see your flag billowing in the wind.

Materials and Textures

Since we are using Cycles, set the render engine to Cycles Render. Then go into the Compositing layout. This setting is to the right of the help menu. Next, change the node type to Materials. This button is to the right of the Node menu in the Node Editor window.

Now select the flag in the 3D view window and add a material in the materials panel. You should see a Diffuse node and Material Output node appear in the node window.

The first node we will add is the Image Texture node (Shift-A, Texture, Image Texture). In that node, open the image of your flag and connect the color output to the color input of the Diffuse node.

The other two nodes add ripple details to your flag. Add a Noise Texture and Wave Texture node. Then change the settings and connect the nodes as shown in the image here. Once you have done that, you can pause your animation while your flag is waving and render your flag. You have now created a billowing flag!

Keep Learning!

No single tutorial will cover everything, so if you want to dig deeper, here are some resources for you to check out. If you have other resources you think I should add to this list, feel free to let me know!

Blender Docs

Tutorials

Books

Popular Now

Comments

  •  irascibleone / 2548 / AAA
    I don't think you should need soft body turned on to make it work. Did you try boosting the Strength setting way up or turning down Gravity (in Cloth Field Weights settings) to see if that makes a difference? I might need to go through the tutorial to make sure everything is up to date.

    As for the shifting, do you think that is because the pinning isn't working properly or if it's a parenting issue, since you are sticking it onto a model? Really hard for me to say what could be wrong without seeing it.
  •  lordmucaus / 0 / unranked
    I attempted this while trying to make a cape for a model, but I cant seem to get the wind to work without using soft body physics on the cape, but when I enable soft body, the cape shifts out of place. Is there something else they didn't mention here?
  •  irascibleone / 2548 / AAA
    It shouldn't be different. I don't think Blender has changed that tool since I wrote the tut. I can look into it though. Maybe you clicked on the subdivide button more than once?

    Either way, the number of cuts is more of a suggestion than anything. As long as you don't have too few vertices that it doesn't look good and don't have so many vertices that your computer cannot handle it, then you should be good.
  •  anonymous / 39 / rookie
    When I did the Subdivide by 10 cuts, it ended up looking WAY different than yours. Mine has way more vertices. Did I do something wrong?