Hello,
Short version: How to actually use the svddecomp vex function once I successfully calculated a weighted covariance?
Long version:
I am working on a liquid project and am trying to implement a formula from a mathematical paper (for the first time ever...). The poblem function deals with SVD decomposition and is found in point 4.1 of this paper: https://ryichando.graphics/sheetflip/download/sheetflip.pdf
Anyways, I learned a lot already, but I am hitting a wall looking at the svddecomp entry from the houdini manual:
"void svddecomp(matrix3 input_M, matrix3 &output_U, vector &output_S, matrix3 &output_V)"
First I don't understand the "void" aspect. How do I actually apply this function? Second, I am not sure what I need to feed into it and what the "&" sign means. I guess "&" means something like optional input. Is that correct?
Do I need to calculate the output_U S and V first? I'm confused.
I think I understand the general usage of the covariance and SVD decomposition,even though I cannot grasp the math 100%.
My goal is to detect the thin sheets and "edges" of my fluid sim, to then apply forces relative according to that mask.
I tried to do ths with volume workflows using density and curvature but my results were never really good.
Thanks a lot!
Oliver
SVD Decomp and fluid sheets
2358 2 1-
- O_Speiser
- Member
- 12 posts
- Joined: March 2020
- Offline
-
- tamte
- Member
- 9379 posts
- Joined: July 2007
- Offline
Anak_Sulap
First I don't understand the "void" aspect. How do I actually apply this function? Second, I am not sure what I need to feed into it and what the "&" sign means. I guess "&" means something like optional input. Is that correct?
Do I need to calculate the output_U S and V first? I'm confused.
the void form of the function needs to return 3 values, therefore it itself returns nothing, and it's returning them by modifying variables marked as & in place
usually those just need to be initialized but their values are not needed for computation, they are just gonna be populated with the results
it's just how its made, it could of course be a vector type (instead of void) like the second form and return the same vector of singular values and just U and V matrices would be returned as modified input arguments variables, but that's just a detail of implementation
Edited by tamte - Feb. 28, 2022 14:54:07
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- animatrix_
- Member
- 5100 posts
- Joined: Feb. 2012
- Offline
Hi,
Those function arguments with & means they are passed by reference:
https://www.educative.io/edpresso/pass-by-value-vs-pass-by-reference [www.educative.io]
Those function arguments with & means they are passed by reference:
https://www.educative.io/edpresso/pass-by-value-vs-pass-by-reference [www.educative.io]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
-
- Quick Links

