Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flipping cloth? ScaleX == -1?
#3
(14-08-2019, 09:10 AM)josemendez Wrote: You cannot scale cloth itself, it does not make any sense mathematically speaking. You cannot describe the rotation/translation/size of a deformable object using a single affine transform. You can only scale the solver, as long as simulation is taking place in local scale. You can think of it as scaling the space around the cloth. See:
http://obi.virtualmethodstudio.com/tutor...space.html


Now, since mesh normals must be recalculated every frame for cloth simulation, flipping the mesh by scaling along one axis will also flip its normals (since triangle winding changes order: clockwise becomes counterclockwise and vice-versa). This cannot be avoided. Your best bet is to take this into account in the shader and un-flip the normals in the vertex shader if the scale is negative along one axis.

PD: wouldn't it be possible to just rotate the cloth 180 degrees on the Y axis? way simpler and cleaner than flipping using negative scale on one axis...

You are making things unnecessary confusing, it is clear from your answer that my suggested approach can fix absolutely everything: let me know where you compute stuff and I will make sure that my mesh is NOT flipped just before the calculation and flipped again (if necessary) just after the calculation. Then there would be no reason to do anything else, as normals won't be flipped (they aren't for all of my other meshes) and mesh simulation would be absolutely clean and clear. This approach works perfectly with Final IK - it will work with your plugin too.

Ofcourse I thought about rotating the character. But for now it would introduce quite a number of complications into the project and would require quiet a large body of work to be done to be worth it.
Reply


Messages In This Thread
Flipping cloth? ScaleX == -1? - by cubrman - 13-08-2019, 05:29 PM
RE: Flipping cloth? ScaleX == -1? - by josemendez - 14-08-2019, 09:10 AM
RE: Flipping cloth? ScaleX == -1? - by cubrman - 14-08-2019, 11:11 AM
RE: Flipping cloth? ScaleX == -1? - by josemendez - 14-08-2019, 12:19 PM
RE: Flipping cloth? ScaleX == -1? - by cubrman - 14-08-2019, 04:48 PM
RE: Flipping cloth? ScaleX == -1? - by josemendez - 14-08-2019, 05:30 PM
RE: Flipping cloth? ScaleX == -1? - by cubrman - 22-08-2019, 06:13 PM
RE: Flipping cloth? ScaleX == -1? - by josemendez - 23-08-2019, 07:17 AM
RE: Flipping cloth? ScaleX == -1? - by cubrman - 23-08-2019, 10:03 AM
RE: Flipping cloth? ScaleX == -1? - by josemendez - 23-08-2019, 10:05 AM
RE: Flipping cloth? ScaleX == -1? - by josemendez - 23-08-2019, 10:35 AM
RE: Flipping cloth? ScaleX == -1? - by cubrman - 23-08-2019, 12:10 PM
RE: Flipping cloth? ScaleX == -1? - by josemendez - 23-08-2019, 01:06 PM