# T2 Apply the force

In ClothSim.cpp

#### Find the force assignment

Search **TODO 2**

You are expected to find the following

```cpp
if (bPlaySim) 
			// F(v) = Mg + Fwind + Fairresistance + spring
			// [TODO 2]: accumulate gravity, wind, air resistance and spring forces
			// replace 0 with your formula
			forces[v] = glm::vec3(0);
}
```

Try to replace glm::vec3(0) with the the forces in the hint

#### Names of force variables

The following are the names of those related forces:

gravity (Mg) : gravity

spring force: spring&#x20;

wind force :wind

air resistance force: F\_air\_resistance

#### Start from gravity

We can start by applying the gravity

```cpp
		if (bPlaySim) {
			// F(v) = Mg + Fwind + Fairresistance - spring
			// [TODO 2]: accumulate gravity, wind, air resistance and spring forces
			forces[v] = gravity;
		}
```
