此 API 是实验性的
其行为可能在 p5.js 的未来版本中发生变化。
Applies a p5.strands transform to a position.
A transform is a matrix, and moving a point with it means multiplying the two together. Doing that by hand needs an extra 1 tacked onto the end of the position first, and the extra component stripped off the answer. transformPoint() takes care of both steps.
With a 2D transform from transform2D(), pass a two-component position and a two-component position comes back. With a 3D transform from transform3D(), pass a three-component position and a three-component position comes back.
Use transformNormal() for surface directions instead, since those must ignore the move part of a transform.
Note: transformPoint() can only be used inside a p5.strands shader callback.
示例
语法
transformPoint(transform, point)
返回值
the moved position, with as many components as the one passed in.
Notice any errors or typos? Please let us know. Please feel free to edit src/strands/strands_transform.js and open a pull request!