Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flipping cloth? ScaleX == -1?
#2
(13-08-2019, 05:29 PM)cubrman Wrote: I want to flip the cloth, that is to set it's scale X to -1, and I have two problems:

1) Cloth turns black (as if in the shadows) after the flip, even if you turn off the shadows.
2) Cloth obviously is not solved properly. But this is not a problem, because I have already solved a similar case with FinalIK, what I need is to know precicely where the solving is taking place and to flip my mesh back again just before and just after the solving process.

I am using a double-sided shader based off of the Standard Shader.

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

Quote:Local space simulation allows to translate/rotate/scale the entire simulation result by scaling the solver transform.

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...
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