cross
Calculates the cross product of two 3D vectors, yielding a new vector that is perpendicular to both inputs.
Core Advantages
It abstracts a core geometric operation, allowing developers to think in terms of 'finding a perpendicular direction' rather than implementing complex formulas. This greatly enhances the readability of the node graph and maintains a declarative, data-flow-oriented workflow.
Common Uses
Dynamically calculating surface normals
Constructing Tangent Space (TBN Matrix)
Generating orthogonal vectors for movement (e.g., camera strafing)
Defining plane orientation in procedural modeling
How to adjust
Its behavior is entirely controlled by its two vector inputs. Swapping the inputs will invert the direction of the resulting perpendicular vector (following the right-hand rule). Decreasing the angle between the input vectors will decrease the length of the output vector, which becomes zero when the inputs are parallel.
Code Examples
1// B = cross(N, T)
2const bitangent = cross( normalWorld, tangentWorld );