I need help understanding the dfdv matrix and how to calculate it. I need to compute the dfdv matrix for the springs. I’m trying to follow these notes here but I still don’t understand, why it’s mentioned that I need a 3×3 matrix
Here’s the code I have right now
// Construct the dfdv matrices per spring
void ParticleSystem::dfdv()
{
Eigen::Matrix3f dfdv = Eigen::Matrix3f::Zero();
for (Spring* spring : m_springs)
{
Particle* particle1 = spring->particles[0];
Particle* particle2 = spring->particles[1];
Eigen::Vector3f distance = particle2->x - particle1->x;
Eigen::Vector3f normalizedDistance = distance / normalizedDistance.norm();;
dfdv += spring->b * (normalizedDistance * unitDisplacement.transpose());
}
}