pygame is
Simple DirectMedia Layer is
Site Swing
Realtime CPU Cloth

Realtime CPU Cloth - 1

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 Press ESCAPE to exit, or any other key to restart the simulation. Mouse Left-Click and drag to rotate, scroll wheel zooms. Enjoy.


Home Page:


click to view original size


Realtime CPU Cloth - 2 - Dec 27, 2012
Realtime CPU Cloth - 1 - Jul 28, 2009 account Comments

If you wish to leave a comment with your account, please sign in first.

December 27, 2012 11:12pm - Ian Mallett - nickname: (geometrian)
Version 2 released!
October 26, 2009 2:32pm - Ian Mallett - nickname: (geometrian)
You may contact me at (see my website under "Contact").
October 1, 2009 11:40am - Arkapravo Bhaumik - nickname: (arkapravobhaumik)
Ian may I ask for your e-mail .... I will send across the errors I am getting .... I guess it will allow me to understand opengl/pyopengl better ....
September 29, 2009 3:56am - publeo - nickname: (publeo)
wow! saw your youtube movie, very very impressive! looking forward to your library release
September 27, 2009 9:44am - Unknown - nickname: (cib) - 5/5
Nice, I'd like to see a game using something like this, but I don't think my 3 year old business laptop could handle it :p
August 4, 2009 9:16pm - Ian Mallett - nickname: (geometrian)
Which line/file? The program is actually pretty simple; with all the simulation taking place outside of OpenGL.
August 3, 2009 8:01pm - Arkapravo Bhaumik - nickname: (arkapravobhaumik)
Could not make it work ! .... said OpenGL.error (err = 1280). However , it seems you are attempting something really exotic ! All the best !
August 2, 2009 2:28pm - Ian Mallett - nickname: (geometrian)
Here's the GPU version, which will be included in the next release of my library:
July 29, 2009 1:07pm - Ian Mallett - nickname: (geometrian)
Nope. I'm not even out of high school.
July 29, 2009 1:03pm - Tero Tapani Ranta - nickname: (tzerba)
May I ask are you a professional programmer?
July 28, 2009 11:53am - Ian Mallett - nickname: (geometrian)
Version 1 released!

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Jan 31, 2017

Jan 24, 2017

Jan 19, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)