/cloth-playground

Experiments with cloth simulation via Verlet integration

Primary LanguageC++BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Cloth playground

This is a simple implementation of cloth physics in C++, with the scene scriptable via Lua, rendered using OpenGL.

Description

This project aims to create a scriptable playground for cloth simulation. It also serves as a playground for embedding Lua.

The simulation is done using a method similar to that described in this 2001 paper. Inspiration was partly taken from the GLSL cloth example from the NVIDIA Graphics SDK 9.5.

Dependencies

The project uses:

Building on Windows

Prebuilt GLUT binaries can be downloaded here. GLEW binaries are provided on the project page.

The script build-w32.cmd serves as a reference on how to build the code under Windows.

If you use Visual Studio 2008, the script should work after tweaking the GLUT_PATH and GLEW_PATH variables. Contributions for automated builds using other versions of Visual Studio are welcome.

Building on GNU/Linux

After installing GLEW and GLUT the build process should be as easy as:

mkdir build
cd build
cmake ..
make

The script `build.sh' is provided for reference and convenience.

Running the demo

Once you have a cloth-playground executable you can run it as

cloth-playground [scene.lua]

for example:

cloth-playground sample-scenes/sphere_test.lua

The mouse rotates the camera, Space stands for pause/unpause.

License

Copyright (c) 2012 Taras Shpot, distributed under the BSD license.