Cloth Simulator

Kaitlynn Gray, Ryan Nguyen, Kishore Rajesh

Course: Computer Graphics

Tools: Python, PyGame

I collaborated with 2 students to add colors and effects to an online cloth simulator in Python.

Description

We built off of a programmer’s cloth simulator created using PyGame, a Python library to create games. Our project focused on styling the cloth by adding colors, a double-sided feature, background effects, and fun particle effects.

The original cloth simulator before we added our edits. See the original creator here. Image from our Slide Presentation..

Our bedazzled cloth, filled with color!

My Code Contributions:

I worked on calculating how to create a double-sided effect on the cloth, designed the final patterns for the cloth, and programmed the background color to change based on which side of the cloth was showing.

In my own time, I implemented 2D “spheres” that replace the cloth patches with a ball that can change orientation.

Videos

2D Sphere Effect

My 2D sphere effect that makes the cloth look puffy.

Pink Pep Effect

A pink puffy jacket effect on the cloth.

Purple Pep Effect

A purple puffy jacket effect on the cloth.

Sherbert Effect

A puffy overlay to the cloth with puffs shifting from pink to yellow.

Sparkle Effect

Adding sparkles to the cloth.

Code Flow

This is a diagram my team created (and I designed) showcasing how our project functions. Click/tap it to view the PDF version!

The code flow for our project.

Cloth Patterns

I designed these cloth patterns in Canva to use on our cloth. The first is called “Sunset,” and the second is “Space,” which reminds me of the aliens found in the movie Toy Story.

I wanted to create a sharp distinction between both sides so it was clear to see when the cloth flipped over. I achieved this by using contrasting color palettes for each side. However, I tie both together by having a bottom border that aligns in both designs.

The Sunset cloth, picturing a deep red sky fading into yellow and purple clouds.

The Space cloth, picturing a deep blue background overlaid with disks layered in blue, white, and lime green.