taiya / dgp

Digital Geometry Processing - Fall 2016 - University of Victoria
38 stars 11 forks source link

How to get L_uu and L_uk #19

Closed xuzheng0927 closed 7 years ago

xuzheng0927 commented 7 years ago

The slides look a bit brief so not sure if I'm following the right logic. In the function factor_matrices, I'm doing:

1, Get Laplacian matrix (either uniform or Beltrami). 2, Multiply the Laplacian matrix by itself to get the squared Laplacian. 3, Permute the (squared) Laplacian matrix by multiplying it with permute (permute the rows). 4, Get block(0,0,u,u) as L_uu and block(0,u,u,k) as L_uk. 5, Permute the vertex matrix, then get the first u vertices as v_u and the rest as v_k. 6, Use the Cholesky solver to compute L_uu.

Then when the mouse is being dragged, I'm doing: 1, Compute the current barycenter of the selected handle, and the displacement between it and the cursor position. 2, Translate all the selected handle's vertices using the displacement by adding the displacement to v_k (only to the selected handle's vertices). 3, Use the Cholesky solver to solve -L_uk*v_k, then save it as the new v_u. 4, Write v_u and v_k as the new vertices by vertices_matrix(mesh) << v_u, v_k.

Is the above logic correct? Right now I'm only getting a pile of exploding points, and I wonder what is going wrong.

xuzheng0927 commented 7 years ago

I think it should be L_square_permute = permute * L_square * permute.transpose(). But the PermutationMatrix is too annoying, I cannot do the above computation whatever I tried.

taiya commented 7 years ago

We did it today in class, I hope your question in answered ;)