modelDirection
Provides the model's forward direction (its local -Z axis) in world space. This vector is normalized.
Core Advantages
Drastically simplifies obtaining an object's orientation. It replaces complex, error-prone manual matrix calculations (transforming a local vector by the model matrix and normalizing) with a single, self-explanatory node.
Common Uses
Creating orientation-dependent effects, such as rim lighting that only appears when an object is viewed from behind.
Directing visual effects like thruster glows or particle streams to always emit from the back of a model.
Debugging an object's orientation by visualizing its direction as a color.
How to adjust
The output of this node cannot be adjusted with parameters. Its value is determined entirely by the rotation of the 3D object to which the material is applied. To change the `modelDirection` vector, rotate the object in the scene.
Code Examples
1const alignment = modelDirection.dot( viewDirection );
2const emissionStrength = smoothstep( -1.0, -0.8, alignment );
3
4// Make the model glow when it directly faces the camera
5material.emissiveNode = vec3( emissionStrength );