How to make a cloth example rotate?

Hello everyone,

while studying a clothing example,

I encountered an issue: when rotating the fabric by 90 degrees, the collision detection fails.

I tried adjusting the mesh position and matrix, but the collisions still don’t work correctly. Could someone advise on the proper way to handle this?

I’d like the fabric to move and rotate properly.

1 Like

Try to rotate the geometry.

1 Like

hanks for the tips. I tried using geometry.rotateY, but the cloth wouldn’t rotate.

I also tried copying the model’s rotation matrix (mat3) and applying it during position calculation, but it still didn’t work. The code below results in incorrect collisions or excessive forces.

            const localPosition = vertexPositionBuffer.element(instanceIndex);

            const position = localPosition
                // .mul(clothRotMatrixUniform)  
                .add(clothPositionUniform)  
                .toVar('vertexPosition');