How to do Cloth Simulation on Virtual Clothing in Lens Studio

1. Clear Your Workspace:

Open the cloth simulation template in LensStudio. Clear the Object Hierarchy as shown below. I will explain why did we do this later in the tutorial.

2. Modelling:

There are plenty of ways in which you can model or design a piece of clothing so I will just cover what one should take care of while working with Cloth Simulation. When modelling for cloth simulation template, Lens Studio documentation recommends a mesh of a maximum of 3000 triangles. But the best-looking cloth mesh I could come up with low poly modelling was 9k+ triangles XD. To my surprise, it just worked fine. But yes it does have a frame drop in the experience if the mesh has too many faces to calculate the simulation on.

3. Vertex painting:

Vertex painting is simply as its name suggests assigning colors to each vertex in the mesh. This step in our tutorial is the most important and more than that it is the biggest pain in the A :’). Well for me it was more than a task to actually nail a vertex painting that does what I expect of it. In the Cloth Simulation template, vertex painting is mainly responsible for Holding parts of the mesh, like you would hold a hanging cloth in your hand. It keeps the vertices stable concerning the bind points you assign the color to. To be more clear on my previous statements you can watch a short tutorial by Kavin Kumar on vertex painting.
In the Cloth Simulation template (on LensStudio v.4.10+) you are allowed to have multiple vertex colors following different objects. These objects are called bind points. If you see your object hierarchy there are a few more sub-hierarchies of objects, one of which is BindPoints Object.

4. Lens Studio Setup:

Now that we have vertex painted our model it’s time to import it into your Cloth Simulation Project. Once it’s in your resources panel you just have to plug things into the script and configure the cloth simulation script according to your vertex colors.




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store