Skip to content

hems-bhandari/cloth_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloth Simulation in C++ with SFML

This project implements a cloth simulation in C++ using the SFML (Simple and Fast Multimedia Library) for rendering and window management.

Prerequisites

To build and run this project, ensure you have the following installed:

  1. Homebrew (for managing dependencies on macOS)

  2. SFML Library (installed via Homebrew)

    brew install sfml@2
  3. g++ Compiler with C++17 support

Files

  • main.cpp: The main source file containing the cloth simulation logic.
  • Makefile: Build instructions for compiling the project.

Building the Project

  1. Clone the repository or download the source files.

    git clone <repository-url>
    cd <project-directory>
  2. Build the project using the provided Makefile.

    make

    This will compile main.cpp and generate an executable named main.

Running the Application

After building the project, run the executable:

./main

Features

  • Simulates cloth dynamics using a particle-based approach.
  • Implements constraints and spring physics for realistic behavior.
  • Renders the simulation using SFML for interactive visualization.

Cleaning Up

To remove the generated files (executable and object files):

make clean

SFML Library

This project links against the following SFML libraries:

  • sfml-graphics
  • sfml-window
  • sfml-system

These libraries are included via Homebrew at the following paths:

  • Include Directory: /opt/homebrew/opt/sfml@2/include
  • Library Directory: /opt/homebrew/opt/sfml@2/lib

Notes

  • Ensure Homebrew's SFML installation paths are correctly set. If you encounter issues, confirm the paths using:

    brew info sfml@2
  • The Makefile assumes the source file is named main.cpp. Update the SRC variable in the Makefile if additional source files are added.

Acknowledgments

  • SFML for the multimedia library
  • Homebrew for package management
  • Guide that I used to build this

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published