Skip to main content

Realtime CPU Cloth - 1

A modest OpenGL demo demonstrating cloth running on the CPU.


Ian Mallett
(geometrian)
I'm working on a new game, and the characters need clothes! So, I've been looking into ways for simulating cloth. A great method is to consider the cloth as a grid, with each point being linked to neighboring points by mathematical "springs".

The CPU is rather slow at massively parallel tasks like this, and so the resolution of the grid must be fairly small. I'm currently working on improving a GPU cloth implementation that can run much more detailed grids, though it is currently suffering from precision errors. In addition, the cloth can be rendered solid much more easily. When it is complete, it will be included in my new OpenGL Library (sneak peak included here) standard--you'll only need a few calls.

The demo is very straightforward. Run cloth.py. Press ESCAPE to exit, or any other key to restart the simulation. Mouse Left-Click and drag to rotate, scroll wheel zooms. Enjoy.

Links

Home Page
http://www.geometrian.com/programming/projects/index.php?project=Realtime%20CPU%20Cloth
Source
http://www.geometrian.com/data/programming/projects/Realtime%20CPU%20Cloth/1/ClothDemo.zip

Releases

Realtime CPU Cloth 1 — 28 Jul, 2009

Realtime CPU Cloth 2 — 27 Dec, 2012

Pygame.org account Comments