pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
Realtime CPU Cloth

Realtime CPU Cloth - 2

Ian Mallett (geometrian)

Tags:

Description

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.

Changes

Completely rewritten. Has fewer dependencies, is more robust, and works better. Uses Verlet instead of Euler integration, and has constraint-limiting pass(es). Gravitation set to -1.0, but customizable.

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/2/ClothDemo2.zip

Screenshot


click to view original size

Releases

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

Pygame.org account Comments

If you wish to leave a comment with your pygame.org 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 ian@geometrian.com (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:
http://www.youtube.com/watch?v=wYLloS0-N2s
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!
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

Sep 8, 2014

Sep 7, 2014


Sep 5, 2014

Aug 26, 2014

Aug 21, 2014


Aug 18, 2014

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