In my specific scenario I need to align the roof texture to the individual roofes. I cannot align the roofes in the UV map because there are too many and its real word data.
My thinking is that I can use the Geometry node and its Normal output to get information about the face orientation, I then just need to calculate the angle of each face, which I can plug into the Mapping node, resulting in the correct texture rotation for each roof face.
The formula for calculating the angle between two vectors (normals) is θ = cos-1 [ (a · b) / (|a| |b|) ]
I tried to create this formula as a node with the Node Quick Maths extension and with Vector Math nodes. I also figured that I was only interested in the Z rotation, so I only needed X, Y (2D coordinates) in the calculation.
The outcome is not what I expected, there is rotation but the wrong rotation, which leads me to believe that either my math is wrong (which could very well be that I am not that well versed in math or Blender math nodes) or I need to approach this in a whole new direction.
What I would like to happen.
let me know if there are Qustions. Thanks a lot ...