Edge detection through Bevel Node

When you use the ‘old trick’ at ~10:35, that is a bit of an ‘ugly’ way of doing things, first getting too much information by taking the Cross Product (that most people don't understand), which produces Vectors and then converting them in some way ('nobody' knows in what way) into single values...


1 love
Reply
  • spikeyxxx replied

    There is a much easier and clearer way to get the Edges, by simply looking at the difference between the original Normal and the Bevel:

    Edges.png

    However, when that small tutorial about Edge detection through the Bevel Node was made, we didn't have all those fancy Vector Math Nodes (only Cross Product and Dot Product, if I'm not mistaken) we have now, so then it was probably the easiest way to do this.
    The Cross Product is just another, indirect way to measure the difference (in direction) between the original Normal and the Beveled one...now that we have the (Vector Math) Distance Node, that makes things easier to understand…
    The Distance Node calculates the distance between 2 Vectors namely the original Normal and the Beveled Normal. But the main thing to remember is, that when both are the same, the Distance and the Cross Product are zero and towards the ‘edge’, the Distance increases and the Cross Product results in a larger Vector.
     Jonathan Lampel has explained this really well in his:

    https://cgcookie.com/lessons/visualizing-vector-math

    starting at ~19:53. In about two minutes you'll know all you need to know about the Cross Product and the Distance (but watch the whole tutorial!).
    Here the red line is the Distance between the 2 Normal Vectors and the Cross Product would be a Vector perpendicular to the 2, with a length determined by the area of the yellow surface:

    Vectors.png

    So, if the two Vectors are aligned, the surface area would be zero, hence the Cross Product would be a Vector of length zero, being (0, 0, 0)...and the Distance would obviously also be zero.


    • amazing tip! 👏
    1 love