Coder Social home page Coder Social logo

korzen / particlesolver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ebirenbaum/particlesolver

0.0 2.0 0.0 2.63 MB

CPU and GPU implementations of a particle-based physics simulation based on Macklin et. al's "Unified Particle Physics for Real-Time Application".

License: MIT License

CMake 0.06% C++ 92.05% C 4.54% Objective-C 0.49% QMake 0.16% GLSL 0.03% Cuda 2.67%

particlesolver's Introduction

Unified Particle Solver

An implementation of Macklin et. al's Unified Particle Physics for Real-Time Applications for both the CPU and GPU.

This physics simulation was implemented on both the CPU (leveraging the Qt framework) and GPU (using CUDA) as a final project for Brown University's graduate-level course CSCI2240: Interactive Computer Graphics by Evan Birenbaum '15, Logan Barnes '15, and Geoff Trousdale '15.

Overview

The simulation supports a variety of states of matter by representing the entire world as a large set of small, individual, and independent particles that are influenced by a set of constraints. The system supports the following physical phenomena with two-way interaction:

  • Inter-particle collisions
  • Rigid bodies with approximated stacking
  • Friction
  • Rope and cloth
  • Fluids
  • Gases

CPU demo scenes

The following demo scenes are built in the CPU application, labeled with appropriate key commands to bring them up:

  • 1 - A collapsing sand pile demonstrating frictional effect on angle of repose
  • 2 - Stiff stacks of rigid bodies
  • 3 - Stable stacking of rigid bodies in the formation of a wall
  • 4 - Chained rigid bodies acting as a pendulum
  • 5 - A fluid caught and held by a rope
  • 6 - Two fluids settling, demonstrating the Rayleigh-Taylor instability
  • 7 - Solids sinking or floating based on density
  • 8 - Gas particles interacting with a swinging rope
  • 9 - A rigid body being stopped by friction
  • 0 - Fluids trapped like a water balloon
  • D - Gas particles emitted into a closed space
  • S - Gas particles emitted into an open space
  • W - I came in like a wrecking ball!
  • N - Newton's cradle
  • . - Resolution of interlocked rigid bodies
  • V - A volcano erupting and settling

The following commands may also be useful:

  • T - Toggle real-time or time-step mode
  • Space - move forward by a time step during time-step mode
  • R - reset the simulation
  • C - toggle rendering of individual particles

GPU demo scenes

Note: This version of the program no longer uses the CUDA 7 cuSolver library allowing it to be run on CUDA 5 capable machines.

The following demo scenes are built in the GPU application, labeled with appropriate key commands to bring them up:

  • 1 - A single rope demonstrating basic distance constraints
  • 2 - A cloth created with a grid of distance constraints
  • 3 - Two fluids settling, demonstrating the Rayleigh-Taylor instability
  • 4 - A single stack of solid particles
  • 5 - Multiple stacks of solid particles
  • 6 - A grid of solid particles falling into a cloth net
  • 7 - A giant ball of fluid being fluidy, and demonstrating surface tension
  • 8 - A combo scene of solid particles, cloths, ropes, and an immovable sphere
  • 9 - Hair...just hair
  • 0 - Empty scene

Moving around in the scene:

  • W - Move forward
  • A - Move left
  • S - Move backward
  • D - Move right
  • Mouse - Look around
  • Left Click - Shoot particle into scene
  • Space - Add fluid to scene at origin (not guaranteed to maintain stability)

Pretty pictures

particlesolver's People

Contributors

ltbarnes avatar ebirenbaum avatar

Watchers

James Cloos avatar Przemyslaw Korzeniowski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.