Cloth Simulation – Simulation and stitching of clothes with realism

Written by
Rohit Magdum
Published on
December 19, 2023

Overview

Nowadays new software/websites offer a simulation of clothes with realism. This mainly includes online clothing stores or fashion-related stuff. The client required to render a cloth which looks real and behaves like a real cloth. It should be stitched to gather like real stitched cloth.

Challenges

The client's requirement was to simulate a cloth with physics and with realism.

Rendering a grid, identifying edges programmatically.

Stitching those edges.

Simulating it like a cloth.

Skillset

Expertise in computer graphics technologies like OpenGL, WebGL, THREE.js.

Expertise in native language coding especially C, C++.

Solutions

Rendering – The rendering part is implemented in WebGL. For cloth rendered a triangulated grid/mesh.

Edge Detection – For edge detection use Half Edge data structure. Two meshes are rendered – The right edge of the left mesh and the left edge of the right mesh are identified, using an edge data structure.

Stitching – The edges are stitched by having a triangulation of edged vertices. For this we used ear cut triangulation library.

Simulation – It is done by adding the physics part to the rendered mesh. We primarily used displacement mapping and used canon.js. For realism, we added texture and light effects using native webGL.

 Outcome

The solution was implemented using native web graphics technology.

Technical know hows and Understandings

Understanding of OpenGL, WebGL, Three.js.

Understanding of C, C++.

Have Any Thoughts...
Let us know if you have any thoughts on the article. We would like to discuss and here your point of view or resolve any queries that you have on the case study.
Write To Us