/opencloth.ts

Cloth simulation algorithms (Position Based Dynamics and Mass-Spring System) implemented in TypeScript

Primary LanguageTypeScript

OpenCloth.ts

This is a web based port of some examples from the OpenCloth library.

The changes in this port includes:

  • Works in web browsers that supports WebGL technology
  • Forms to easily edit the simulation configuration
  • Rewritten to object oriented approach

The repository contains examples for two simulation methods:

  • Mass-Spring System (Explicit Euler)
  • Position Based Dynamics

Features missing:

  • Moving and rotating the camera
  • Mouse interaction with simulated cloth

Purpose

This project was written as a part of my master’s thesis titled:

Implementation of cloth simulation algorithms

Code in this repository is not state of the art but it does its job.

Live online demos

How to run it locally?

  1. Clone the repository
  2. Install the Bower package manager
  3. Install the TSD manager
  4. In project directory run bower install
  5. In the same directory run tsd install
  6. Open the mss.html or pbd.html file in a web browser

License

Copyright (c) 2015 Marcin Gajda. MIT license applies.