이 API는 실험적입니다
향후 p5.js 버전에서 동작이 변경될 수 있습니다.
Turns a 3D p5.strands transform about any axis.
rotateX(), rotateY(), and rotateZ() only turn about the three main axes. rotateAxisAngle() turns about a line pointing in any direction, given as a three-component vector. The axis doesn't need to be a unit vector; it is normalized before use.
A new transform is returned and the one passed in is left untouched, so the result has to be assigned back, as in t = rotateAxisAngle(t, [1, 1, 0], PI / 4).
Angles are always measured in radians here, since angleMode() doesn't reach inside a shader.
Note: rotateAxisAngle() only works on a transform created with transform3D(), and can only be used inside a p5.strands shader callback.
예제
구문
rotateAxisAngle(transform, axis, angle)
매개변수
transform
a transform created with transform3D().
axis
a three-component vector pointing along the line to turn about.
angle
Number: angle to turn by, in radians.
반환값
a new transform with the turn applied.
Notice any errors or typos? Please let us know. Please feel free to edit src/strands/strands_transform.js and open a pull request!