Obi Official Forum
Changing the scale - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: Changing the scale (/thread-1312.html)



Changing the scale - QoQoo1321 - 11-08-2019

Changing the scale of a 3d model with obiCloth applied causes the mesh to appear broken

Please tell me how to respond


UNITY2018.3.14f1

Code that does not cause problems:
Code:
model = (GameObject)GameObject.Instantiate(modelPrefab, new Vector3(0.5f, 0f, 0f), Quaternion.Euler(0, 180f, 0));
[Image: jnjh1rgrzf1lcj...1.PNG?dl=0]
https://www.dropbox.com/s/jnjh1rgrzf1lcj0/image1.PNG?dl=0


The code where the problem occurs:
Code:
model = (GameObject)GameObject.Instantiate(modelPrefab, new Vector3(0.5f, 0f, 0f), Quaternion.Euler(0, 180f, 0));
model.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f);
[Image: image2.PNG?dl=0]
https://www.dropbox.com/s/g6fkx957fqk6ebe/image2.PNG?dl=0


RE: Changing the scale - josemendez - 12-08-2019

(11-08-2019, 08:14 AM)QoQoo1321 Wrote: Changing the scale of a 3d model with obiCloth applied causes the mesh to appear broken

Please tell me how to respond


UNITY2018.3.14f1

Code that does not cause problems:
Code:
model = (GameObject)GameObject.Instantiate(modelPrefab, new Vector3(0.5f, 0f, 0f), Quaternion.Euler(0, 180f, 0));
[Image: jnjh1rgrzf1lcj...1.PNG?dl=0]
https://www.dropbox.com/s/jnjh1rgrzf1lcj0/image1.PNG?dl=0


The code where the problem occurs:
Code:
model = (GameObject)GameObject.Instantiate(modelPrefab, new Vector3(0.5f, 0f, 0f), Quaternion.Euler(0, 180f, 0));
model.transform.localScale = new Vector3(0.4f, 0.4f, 0.4f);
[Image: image2.PNG?dl=0]
https://www.dropbox.com/s/g6fkx957fqk6ebe/image2.PNG?dl=0

Hi there,

You cannot change the scale of a cloth. Mathematically it does not make any sense to apply a rigid transform to a deformable object.

Either create your cloth mesh with correct scaling right from the start, or use local space simulation. In local space, you can scale the simulation space by scaling the solver. See:
http://obi.virtualmethodstudio.com/tutorials/localspace.html