Fabric shader on threejs

Another idea would be to use raycaster to reshape a plane piece by piece.

One can take the two examples as a basis and create a specific solution from them.

From the Collection of examples from discourse.threejs.org

see Interaction with Points

and

Modify indexed BufferGeometry (mouse or input)
see modify Geo

The drawing of points must be processed in such a way that it is only possible within certain limits. Points in a neighbourhood up to a specified distance must follow a compensation curve. The distances can vary in a small percentage. This corresponds to a slight stretching of the fabric during folding.

That doesn’t sound too difficult at first, but I know from experience that the problems are hidden in the details. In a way it has similarities to Addon for triangulation of implicit surfaces/ forms with holes

1 Like