T2 Apply the force

In ClothSim.cpp

Find the force assignment

Search TODO 2

You are expected to find the following

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

wind force :wind

air resistance force: F_air_resistance

Start from gravity

We can start by applying the gravity

Last updated