- Author: Ondřej Vlček (xvlcek27)
This project requires GLFW3, GLM, GLEW and GLAD (GLAD is provided in the project). It can be built with CMake. The resulting executable is called pgpa.
mkdir build && cd build
cmake .. && make
The resulting app has to be launched from its containing folder so it can find shaders and models. The app can be launched without any additional parameters. In that case, a default inflated sphere is loaded.
The user can switch between a few examples in the app itself or load an object on launch. The loaded object has to be in Wavefront .obj format consisting of triangles or quads and must be manifold when filling is turned on. A complete list of launch parameters is given below. If --obj is omitted, then any argument ending with .obj will be treated as an input model.
-
--obj FILE.OBJ- Object to load -
--dt FLOAT- Timestep, default is$\frac{1}{60}$ . -
--stiffness FLOAT- Object stiffness, default is 500. -
--fill- Fill object with an internal structure -
--fillres INT- Object fill resolution, default it 5. -
--pressurize- Start simulation with internal object pressure on -
--pressure FLOAT- Pressure amount, default is 5. -
--damp FLOAT- Dampening, default is$10^{-5}$ . -
--mass FLOAT- Mass multiplier, default is 1. -
--gravity FLOAT- Gravity, default is 9.81.
./pgpa models/sheet.obj
./pgpa models/cube.obj --fill --fillres 5 --stiffness 100
./pgpa --obj models/icosahedron.obj --fill --fillres 1
./pgpa --obj models/icosahedron_large.obj --presssurize --pressure 6
The user can move around using WASD keys and change the view using the middle mouse button. The object can be dragged around using the left mouse button, which grabs the nearest vertex. Vertices can be deleted using the right mouse button. Dragging a vertex and using the right mouse button will pin it in place.
Spacebar- Pause simulation.F- Inflate or deflate object.V- Turn on friction (unstable).U- Unpin all vertices.G,B- Increase and decrease stiffness.H,N- Increase and decrease dampening.J,M- Increase and decrease mass.1,2,3- Switch rendering modes.Ctrl+1,2,3,4- Switch between provided models and settings.R- Reload current model.Q,E- Slow down and speed up simulation (high speed can be unstable).
The project implements the following display modes.
Default mode with fake translucency.

This mode shows stretched edges in red and compressed edges in blue.

This mode showcases vertex colorings used for parallel execution.

Elastic simulation in this project is based on Vertex Block Descent.
