A simple mesh cloth made with OpenGL
 
 
Go to file
Sean Hickey 0593b9d8c5 Add updates to use glfw-legacy. 2021-07-06 21:56:04 -07:00
.gitignore Add updates to use glfw-legacy. 2021-07-06 21:56:04 -07:00
README.md Add updates to use glfw-legacy. 2021-07-06 21:56:04 -07:00
cloth.c fixed a bug where it saved previous point with mouse click and teleported to next click, tearing cloth unintentionally 2013-04-01 22:06:05 -04:00
makefile Add updates to use glfw-legacy. 2021-07-06 21:56:04 -07:00

README.md

OpenGL-Cloth

A simple mesh cloth made with OpenGL

Thanks to this tutorial: http://gamedev.tutsplus.com/tutorials/implementation/simulate-fabric-and-ragdolls-with-simple-verlet-integration/

Essentially, the links in the mesh are modelled as simple springs. When they get stretched too far, they break.

Left click to grab points in the mesh, pulling too hard will break links. Left and right arrows can spin the camera. Space randomly flutters the mesh. ESC quits.

Simple makefile included, so all you need to do is type "make". Requires OpenGL, GLU, and glfw (which probably requires a few things for it to work).

This project was build with an old version of GLFW. It still works mostly as-is if you clone the GLFW legacy code and build the old version from source. Then symlink the include and lib directories like this:

ln -s path/to/glfw-legacy/include ./include
ln -s path/to/glfw-legacy/lib/x11 ./lib

Feel free to use this code (although right now, it's kind of poorly organized...all in one big file). For any legal purposes, consider this Public Domain.

Sean Hickey (Wisellama)