anisotropyT
Creates a `vec3` parameter named `AnisotropyT` in the TSL shader, providing the Tangent (T) vector. It works in tandem with `anisotropyB` (Bitangent) to define the precise orientation of anisotropic effects.
Core Advantages
Completes the TBN coordinate frame required for accurate anisotropic lighting, enabling full programmatic control over the effect's direction, independent of model data, which is crucial for dynamic or procedural surfaces.
Common Uses
Procedurally defining surface orientation, like creating latitudinal gloss on a sphere.
Correcting or re-orienting model tangents, for instance, by swapping T and B vectors.
Creating dynamically rotating effects, such as a spinning brushed metal dial.
Defining direction for one layer in a multi-layered anisotropic material like carbon fiber.
How to adjust
Modify `material.anisotropyT` with a `THREE.Vector3` in JavaScript. For physically correct results, this vector must be kept perpendicular to both the surface normal and the `anisotropyB` vector. Adjusting `anisotropyT` and `anisotropyB` together allows for effects like smoothly rotating the highlight's direction.
Code Examples
1// To animate rotation, update both T and B vectors to stay orthogonal
2const angle = time;
3myMaterial.anisotropyT.set( Math.cos( angle ), 0, Math.sin( angle ) );
4myMaterial.anisotropyB.set( -Math.sin( angle ), 0, Math.cos( angle ) );