x1911
July 23, 2025, 12:53am
1
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
Fennec
July 23, 2025, 1:11am
2
Try to rotate the geometry.
1 Like
x1911
July 23, 2025, 3:41am
3
hanks for the tips. I tried using geometry.rotateY
, but the cloth wouldn’t rotate.
x1911
July 23, 2025, 3:52am
4
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');