Physics applications built with C/C++, OpenGL, and SDL2 for PC at the university.
Particles_SamuelBalcells_SergiSanchez.mp4
The simulation of the particle system is carried out in a box. This system has two types of emitters: fountain and cascade. Its parameters can be adjusted by the user from the interface, such as the emission rate (no less than 100 particles per second) and the lifetime of each.
The main characteristics:
- The Euler method is used.
- Collisions with the planes of the walls and the floor.
- Collisions with certain objects: sphere and capsule.
Cloth_SamuelBalcells_SergiSanchez.mp4
The clothing simulation is carried out in a box. This model deformation system, Provot's model, consists of multiple resorts between particles. And its parameters are adjustable by the user from the interface, such as resorts and collisions.
RigidObject_SamuelBalcells_SergiSanchez.mp4
This simulation, on the handling of collisions in a rigid body, consists of throwing one by applying a force on it, varying the amount and the place where it is applied, so that it collides in different ways with its environment.
Fluids_SamuelBalcells_SergiSanchez.mp4
This basic fluid simulation uses Gerstner waves, one of the most common methods in video games. To make things more interesting, a sphere is added that must fall from a height and sink or float according to its mass. And its parameters are adjustable by the user from the interface, for example, the fluid density, the number of waves, the direction, amplitude and frequency of each, and the mass and radius of the sphere.
This project has been made with Windows. But you should be able to use it on Linux and Mac.
Before you start, make sure you have an IDE/Compiler such as Visual Studio, Code::Blocks or XCode.
Note If you are on Windows, you can skip the first step
- Hello SDL.
- Download the last version of SDL2, SDL2_image and SDL2_ttf corresponding to your operating system (if you are on Windows, see the next).
- Download the last version of OpenGL:
glew32.dll
andglew32.lib
.
- Download the
VC.zip
for Visual Studio or themingw.tar.gz
for Code::Blocks and MinGW. - Create a folder called "libs" in each root project folder: "Particles/libs", "Cloth/libs", "RigidObject/libs" and "Fluids/libs".
- Put the next libraries in the previous folder:
SDL2.dll
,SDL2.lib
,SDL2main.lib
,glew32.dll
andglew32.lib
. - Compile and run the solution in
Debug-x64
.
Samuel Balcells |
Sergi SΓ‘nchez |
---|