이 API는 실험적입니다
향후 p5.js 버전에서 동작이 변경될 수 있습니다.
Applies a p5.strands transform to a surface direction.
A normal describes which way a surface faces, and lighting uses it to work out how bright each spot should be. Normals can't be moved the way positions are: a move must be ignored, and an uneven resize like scale(t, 2, 1, 1) would tilt them the wrong way if the transform were applied directly. transformNormal() handles both cases and returns a normalized result, so lighting stays correct.
Pass the same transform used with transformPoint() for the position, so the shape and its lighting stay in step.
Note: transformNormal() can only be used inside a p5.strands shader callback.
예제
구문
transformNormal(transform, normal)
매개변수
transform
a transform created with transform2D() or transform3D().
normal
the surface direction to transform.
반환값
the transformed surface direction, normalized.
Notice any errors or typos? Please let us know. Please feel free to edit src/strands/strands_transform.js and open a pull request!