Math for VSFX

Updated on March 1  2024

also Houdini Resources


 Overview (pictoral)


copyright © Deborah R. Fowler




Deborah R. Fowler



Dot Product - Any polygon - up or down

Posted Jan 3  2021
updated on Jan 3  2021
updated on June 21  2022 adding link to further generalization (short rod)

Tags: point wrangle, attribute promote, dot product, acos, normalize, length



"Dot Product
is the product of the magnitudes of the two vectors and the cosine of the angle between them. The name "dot product" is derived from the centered dot\cdot " that is often used to designate this operation."  See wiki entry.


Continuing on from the previous discussion about dot product using the lego mechanism, that particular example worked in up but not downward motion. Here is an even more generalized version which works on any polygon or curve. If you have not read the previous section I would encourage you to look at that first.



Like the other example the pointwrangle is similar, however now the attribpromote take into account the case of a maximum or a minimum.



The node network shows the two chains for each direction, max and min with a clip eliminating any ambiguity.



The attribpromote on the left is maximum, on the right minimum and the extra point wrangle on the right is simply negating the attribute "ang" so that it goes in the opposite direction. The switch expression at the end determines the angle selection:



Here is a prototype demo with a triangle:



The "Spin" video that I made lead to an interesting exploration of display of exr versus jpg - a topic for another time.

One step further, would be to use a short rod - click here.