A C++ implementation of Fast Simulation of Mass-Spring Systems

Overview

Fast Mass-Spring System Simulator

A C++ implementation of Fast Simulation of Mass-Spring Systems [1], rendered with OpenGL. The dynamic inverse procedure described in [2] was implemented to constrain spring deformations and prevent the "super-elastic" effect when using large time-steps.

Dependencies

  • OpenGL, freeGLUT, GLEW, GLM for rendering.
  • OpenMesh for computing normals.
  • Eigen for sparse matrix algebra.

Building

You need to install OpenGL, GLEW and GLUT on your system to build. The rest of the dependencies will be automatically fetched by cmake during configuration.

To build, run the following commands from the root directory of the project:

mkdir build
cd build
cmake ..
cmake --build .

On Windows, you will likely need to specify the directories containing GLUT and GLEW in CMAKE_PREFIX_PATH so that cmake can find them.

cmake .. -DCMAKE_PERFIX_PATH:PATH=/path/to/libs

You will also need to copy the DLLs to the build directory if they are not available globally.

Demonstration

curtain_hang curtain_ball

References

[1] Liu, T., Bargteil, A. W., Obrien, J. F., & Kavan, L. (2013). Fast simulation of mass-spring systems. ACM Transactions on Graphics,32(6), 1-7. doi:10.1145/2508363.2508406

[2] Provot, X. (1995). Deformation constraints in a mass-spring modelto describe rigid cloth behavior. InGraphics Interface 1995,147-154.

You might also like...
A heterogeneous OpenCL implementation of AutoDock Vina

Vina-GPU A heterogeneous OpenCL implementation of AutoDock Vina Compiling and Running Note: at least one GPU card is required and make sure the versio

Implementation of light baking system for ray tracing based on Activision's UberBake

Vulkan Light Bakery MSU Graphics Group Student's Diploma Project Treefonov Andrey [GitHub] [LinkedIn] EARLY STAGES OF DEVELOPMENT Project Goal The goa

An implementation of OpenGL 3.x-ish in clean C
An implementation of OpenGL 3.x-ish in clean C

PortableGL "Because of the nature of Moore's law, anything that an extremely clever graphics programmer can do at one point can be replicated by a mer

Deno gl - WIP Low-level OpenGL (GLFW) bindings and WebGL API implementation for Deno.

deno_gl WIP Low-level OpenGL (GLFW) bindings and WebGL API implementation for Deno. Building Make dist directory if it doesn't exist. Build gl helper

Implementation of Peter Shirley's Ray Tracing In One Weekend book using Vulkan and NVIDIA's RTX extension.
Implementation of Peter Shirley's Ray Tracing In One Weekend book using Vulkan and NVIDIA's RTX extension.

Ray Tracing In Vulkan My implementation of Peter Shirley's Ray Tracing in One Weekend books using Vulkan and NVIDIA's RTX extension (formerly VK_NV_ra

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.

pbrt, Version 3 This repository holds the source code to the version of pbrt that is described in the third edition of Physically Based Rendering: Fro

A standalone Dear ImGui node graph implementation.
A standalone Dear ImGui node graph implementation.

ImNodes A standalone Dear ImGui node graph implementation. Library provides core features needed to create a node graph, while leaving it to the user

SMAA is a very efficient GPU-based MLAA implementation (DX9, DX10, DX11 and OpenGL)

SMAA is a very efficient GPU-based MLAA implementation (DX9, DX10, DX11 and OpenGL), capable of handling subpixel features seamlessly, and featuring an improved and advanced pattern detection & handling mechanism.

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor
Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor. When the sensor data gets stuck, the library has a hard reset function to ensure that it is read continuously.

Introduction to Computer Systems (II), Spring 2021.

Introduction to Computer Systems (II) Spring 2021, Fudan University.

A small proxy DLL which enables dev. console in Mass Effect 1, 2 and 3 (Legendary Edition).
A small proxy DLL which enables dev. console in Mass Effect 1, 2 and 3 (Legendary Edition).

LEBinkProxy A small proxy DLL which enables dev. console in Mass Effect 1, 2 and 3 (Legendary Edition). Usage In your game binary directory (Game\ME?\

A CLI utility for the file mass-renaming

─────────────────┨ What is this? ┠───────────────── Nomenus-rex is a CLI utility for the file mass-renaming. ─────────────────┨ Installing ┠─────

System Programming 2021 Spring

sp-labs System Programming Labs 2021 Spring Repo 文件说明 lab: 实验指导书 & 题目。 answer_template: 提供对应 lab 的参考作答模板。建议将图片放至对应的img/文件夹下,使用 Markdown 编写,最后通过 Typora

2021-Spring-Capstone-Design '전기차 무선 충전 로봇'
2021-Spring-Capstone-Design '전기차 무선 충전 로봇'

2021-Capstone-Design 광운대학교 로봇학부 2021년도 1학기 캡스톤 디자인 '로부스'팀 Repository입니다. 개발 기간 : 2021.3 ~ 2021.6 팀원 구성 팀원 맡은 역할 김범수(팀장) 전체 지휘 총괄 및 일정 조율, Fuzzy 제어기 In

Code for the article Spring-It-On

Spring-It-On: The Game Developer's Spring-Roll-Call This repo contains the source code for all the demos from this article. It uses raylib or more spe

Repository for course content (homeworks, projects, recitation exercises) of CSCI 1300 in Spring 2022.

CSCI1300 Spring 2022 Repository for course content (e.g. homework assignments, project write-ups, recitation exercises) of CSCI 1300 in Spring 2022. C

CS370 mTar Spring 2022 (custom tar)

Homework 04: mTar Requirements: Must support two command line options -a file.mtar file1 [files...] -x file.mtar Options, explained: -a file.mtar file

Repository for the App Dev Bootcamp conducted in Spring 2022 for IECSE. Bootcamp mainly focuses on Flutter and Dart.

IECSE-AppDev-Spring-2022 Welcome to IECSE's App Dev Bootcamp, Spring'22. Ever wondered how applications like Instagram, WhatsApp, and others are built

Real-time multi-physics simulation with an emphasis on medical simulation.
Real-time multi-physics simulation with an emphasis on medical simulation.

Introduction SOFA is an open source framework primarily targeted at real-time simulation, with an emphasis on medical simulation. It is mainly intende

Comments
  • Installation failed

    Installation failed

    Hello, This repository looks very interesting, but I'm not able to build it. I'm running Ubuntu 18.04 and installed the dependencies mentioned in the Readme.md I'm not that well versed in c++. I tried my best googling the problems, but I'm stuck. I attached the CMakeFiles folder containing the logs. From what I gather, there is several unknown command lines used. Perhaps a cmake incompatibility? I'm using 3.17

    I would really appreciate it, if you could take a look! CMakeFiles.zip

    opened by Simon-Steinmann 3
  • Getting an error during runtime (probably related to vector): Microsoft C++ exception: std::length_error at memory location 0x0000002A71CFE6E0

    Getting an error during runtime (probably related to vector): Microsoft C++ exception: std::length_error at memory location 0x0000002A71CFE6E0

    Tried to build the code using Visual Studio (didn't use cmake and manually installed stuff) somehow and got these runtime errors in call stack:

    image

    Traces back to these:

    Line 1706 in vector: image

    Line 40 in Shader.cpp image

    Line 175 in app.cpp image

    And Line 123 in app.cpp image

    Apologies if these issues are stupid but I'm totally new to opengl, visual studio and cmake 😅

    opened by aapatre 2
  • Please provide build instructions

    Please provide build instructions

    I don't have a much c++ experience (although I do have plenty of experience in other languages). Building c++ projects has always seemed arcane to me. That being said, I would like to give this project a try as modelling cloth is involved in a challenge my wife has issued me (she likes to sew). Please provide step by step build instructions, including which version of VS is required etc.

    opened by travis-leith 2
  • Missing License

    Missing License

    Hi, your implementation looks nice and tidy. Do you consider add a LICENSE file please? I am very interested in integrate it into my 3D modeling software. Thanks!

    opened by huxingyi 1
Owner
Samer Itani
Samer Itani
Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.

Bullet Physics SDK 10.1k Jan 7, 2023
iMSTK - Interactive Medical Simulation Toolkit

iMSTK - Interactive Medical Simulation Toolkit About Overview Participants Licensing Resources Documentation Discourse Issue tracker Prerequisites Get

Kitware, Inc. 14 Nov 22, 2022
Fast C++ implementation with JSI binding of MD5 for React Native

react-native-quick-md5 Brazingly fast C++ implementation with JSI binding of MD5 for React Native. Confirmed that it's 10x faster than using spark-md5

Takuya Matsuyama 81 Nov 22, 2022
A fast entity component system (ECS) for C & C++

Flecs is a fast and lightweight Entity Component System with a focus on high performance game development (join the Discord!). Highlights of the frame

Sander Mertens 3.4k Dec 31, 2022
This is a fast module to probing an area in a 2d plane for physic objects

Godot AreaProber 2D Checking for neighbour colliders made easy AreaProber allows you to probe for colliders anywhere in your 2D game's world, no need

Strauji 8 Feb 14, 2022
Ipsys Particle System Yey letS go, very cool particle system generator and fast renderer

ipsys - Ipsys Particle System Yey letS go About Ipsys is a piece of software that focuces on running and displaying cool randomly generated particule

Anima Libera 5 May 26, 2022
Minimal A* implementation in C. No dynamic memory allocation.

Micro A Star Path Finder This is a minimal A* path finder implementation in C, without any dynamic memory allocation. Usage The maximum size of the ma

Felipe da Silva 96 Dec 24, 2022
An open-source implementation of Autodesk's FBX

SmallFBX An open-source implementation of Autodesk's FBX that is capable of import & export mesh, blend shape, skin, and animations. Mainly intended t

Seiya Ishibashi 43 Dec 21, 2022
A C++/DirectX 11 implementation of "A Scalable and Production Ready Sky and Atmosphere Rendering Technique"

Atmosphere Renderer A C++/DirectX 11 implementation of "A Scalable and Production Ready Sky and Atmosphere Rendering Technique" Features interactive e

Z Guan 37 Nov 20, 2022
Sandbox for graphics paper implementation

Graphics Experiments 適当にグラフィックス関連の論文などを読んで実装・検証したものを置きます。 I'll randomly put something for implementing/validating graphics papers here. 実装 / Implement

shocker-0x15 86 Dec 28, 2022