Obi Official Forum
Help Towel simulation in Quest - 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: Help Towel simulation in Quest (/thread-4251.html)



Towel simulation in Quest - balaji.v - 12-06-2024

Hi,

I am working on a VR project where I need to grab a towel using a controller and then fold and unfold it, as well as rub the cloth on other objects with collision.

Could you please suggest possible ways to achieve the above simulation?


Thanks.


RE: Towel simulation in Quest - josemendez - 12-06-2024

(12-06-2024, 07:31 AM)balaji.v Wrote: Hi,

I am working on a VR project where I need to grab a towel using a controller and then fold and unfold it, as well as rub the cloth on other objects with collision.

Could you please suggest possible ways to achieve the above simulation?


Thanks.

Hi Balaji,

There's not much involved in doing this. You just need a basic cloth setup with collision detection.

Then you need to decide on a what for the user to interact with the cloth. This can get more complicated depending on which kind of interaction you want, for instance if you want the user to be able to grab it by specific particles you'd use contact callbacks to detect when the hand is close to specific particles, then use the particles API to move these particles around.

kind regards,


RE: Towel simulation in Quest - balaji.v - 14-06-2024

(12-06-2024, 07:37 AM)josemendez Wrote: Hi Balaji,

There's not much involved in doing this. You just need a basic cloth setup with collision detection.

Then you need to decide on a what for the user to interact with the cloth. This can get more complicated depending on which kind of interaction you want, for instance if you want the user to be able to grab it by specific particles you'd use contact callbacks to detect when the hand is close to specific particles, then use the particles API to move these particles around.

kind regards,
Thank you for your reply. 
Instead of directly attaching the particle to the hand, shall I attach the particle to another invisible object (such as a cube or cylinder) and then grab the invisible object with the Quest controller?


RE: Towel simulation in Quest - josemendez - 14-06-2024

(14-06-2024, 12:38 PM)balaji.v Wrote: Thank you for your reply. 
Instead of directly attaching the particle to the hand, shall I attach the particle to another invisible object (such as a cube or cylinder) and then grab the invisible object with the Quest controller?

Yes, you wouldn't be able to scale it otherwise. The idea is that you attach the cloth to a transform, then drive the transform's scale using the Quest controller.


RE: Towel simulation in Quest - balaji.v - 25-06-2024

(14-06-2024, 02:27 PM)josemendez Wrote: Yes, you wouldn't be able to scale it otherwise. The idea is that you attach the cloth to a transform, then drive the transform's scale using the Quest controller.
I have folded wash cloth model. I created blue print for the model and created obi cloth for the model. when playing the scene in unity editor the fps is too low(fps: 3) and not smooth.  How can I fix this. 
[Image: view?usp=sharing]
[Image: view?usp=sharing]
https://drive.google.com/file/d/18ZLFF3wk5y_WXWbZim_9sOmSymJpxWN7/view?usp=sharing
https://drive.google.com/file/d/1cXCblT9p855FJzv_3I03CtDhUbcKuGWR/view?usp=sharing


RE: Towel simulation in Quest - josemendez - 25-06-2024

(25-06-2024, 01:36 PM)balaji.v Wrote: I have folded wash cloth model. I created blue print for the model and created obi cloth for the model. when playing the scene in unity editor the fps is too low(fps: 3) and not smooth.  How can I fix this. 

Hi,

Please don't drag/drop images directly into the forum, host your image somewhere and post a [img] link.

If you're having performance problems, make sure you've properly installed the required package dependencies for Burst as per the manual.
http://obi.virtualmethodstudio.com/manual/6.3/setup.html
http://obi.virtualmethodstudio.com/manual/6.3/backends.html

If you have installed them and performance is still an issue, please share a profiling session with us (in the profiler, top right button allows you to export the session). Otherwise it's pretty much impossible to tell what the issue might be.

kind regards,


RE: Towel simulation in Quest - balaji.v - 25-06-2024

(25-06-2024, 01:49 PM)josemendez Wrote: Hi,

Please don't drag/drop images directly into the forum, host your image somewhere and post a [img] link.

If you're having performance problems, make sure you've properly installed the required package dependencies for Burst as per the manual.
http://obi.virtualmethodstudio.com/manual/6.3/setup.html
http://obi.virtualmethodstudio.com/manual/6.3/backends.html

If you have installed them and performance is still an issue, please share a profiling session with us (in the profiler, top right button allows you to export the session). Otherwise it's pretty much impossible to tell what the issue might be.

kind regards,
Hi, I have installed the packages but still its slow only. please find the profiler data link.

https://drive.google.com/file/d/1n1VJB7sdNye9UukLOhkLknOmMCtJzFBF/view?usp=sharing


RE: Towel simulation in Quest - josemendez - 26-06-2024

(25-06-2024, 03:38 PM)balaji.v Wrote: Hi, I have installed the packages but still its slow only. please find the profiler data link.

https://drive.google.com/file/d/1n1VJB7sdNye9UukLOhkLknOmMCtJzFBF/view?usp=sharing

Keep in mind you must disable the jobs debugger and safety checks when running Burst code in-editor, otherwise it will be much slower due to the debugging/checks overhead. See "Performance" in the manual:
http://obi.virtualmethodstudio.com/manual/6.3/backends.html

Regarding your profiler session: you're updating all physics in the scene 17 times per frame.
[Image: QE3jLlk.png]


This likely means your max allowed timestep is too high, and the workload for each individual update too great.
To reduce the max allowed timestep, go to Unity's Time settings and set max allowed timestep to a small multiple of your timestep (eg. if you're using 0.02 as the timestep, set the max to 0.02 - 0.06)

Zooming into an individual update shows most of the time is spent calculating collisions between particles. If you have a folded towel, it's a lot more efficient to simulate it as a softbody instead of simulating it as cloth and relying on self-collisions to do all the work keeping the folds from penetrating each other.

kind regards,