Name: Karthik Ramesh Iyer UIN: 234009250
- OpenGL 4.x
- GLM
- GLEW
- Eigen
Set the following environment variables:
GLM_INCLUDE_DIR=/Users/karthik/lib/glm-0.9.9.8;GLFW_DIR=/Users/karthik/lib/glfw-3.3.8;GLEW_DIR=/Users/karthik/lib/glew-2.1.0
Clone the project and run the following commands in the root directory of the project:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
To run the simulator:
./pbd-grains ../resources ../data
- The simulation and rendering loop are set up in main.cpp. The approach used is to run both threads in parallel and the simulation thread updates the state which is read by the rendering thread. The rendering thread does not wait for the simulation thread. If the timestep used is
h
and processing one timestep takes timex
, the simulation loop waits for time =max(h - x, 0)
before processing the next timestep. This makes sure that the simulation is displayed at the expected rate. - Grain physics is defined in Grains.h and Grains.cpp
- Spatial Hashing is defined in SpatialHash.h and SpatialHash.cpp
- Blender export/import scripts are in the
export-scripts
directory
This project uses:
- Rendering boilerplate code from Dr. Sueda's Computer Animation course (CSCE-689), which has been modified to support OpenGL 4, and to load multiple scenes whilepausing the simulation
- Eigen for vector math
- https://github.com/g-truc/glm for vector math and for opengl support
- Dear ImGui for immediate mode UI
- One TBB for parallel processing