computer-graphics-mass-spring-systems icon indicating copy to clipboard operation
computer-graphics-mass-spring-systems copied to clipboard

How to Add Pinned Vertex Penalty?

Open CalinArdelean opened this issue 6 years ago • 1 comments

The README tells us to "add these quadratic and linear coefficients to Q and b above correspondingly." Does this mean to add the penalty term to every element in the b and Q matrices? Or only to the rows and columns that correspond to the pinned vertices? None of this seems to work.

CalinArdelean avatar Nov 28 '19 20:11 CalinArdelean

The penalty function is already given to you over the entire network, and the C matrix already encodes the selection of pinned vertices, so you don't need to do any more bookkeeping of pinned matrices after you've constructed C. To include the penalty contribution, you simply add it to the existing energy function you're trying to optimize, and compute derivatives again. It'll still be in the form Qp = b, but Q and b will include contributions from the penalty function.

abhimadan avatar Nov 29 '19 01:11 abhimadan