Skip to content

Files

Latest commit

908c56a · Nov 19, 2024

History

History
109 lines (62 loc) · 4.18 KB

README.md

File metadata and controls

109 lines (62 loc) · 4.18 KB

Physics Programming

Physics applications built with C/C++, OpenGL, and SDL2 for PC at the university.

Table of Contents

Projects

Particles

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:

  1. The Euler method is used.
  2. Collisions with the planes of the walls and the floor.
  3. Collisions with certain objects: sphere and capsule.

Cloth

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.

Rigid Object

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

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.

Getting Started

This project has been made with Windows. But you should be able to use it on Linux and Mac.

Pre-requisites

Before you start, make sure you have an IDE/Compiler such as Visual Studio, Code::Blocks or XCode.

Installation

Note If you are on Windows, you can skip the first step

  1. Hello SDL.
  2. Download the last version of SDL2, SDL2_image and SDL2_ttf corresponding to your operating system (if you are on Windows, see the next).
  3. Download the last version of OpenGL: glew32.dll and glew32.lib.

Windows

  1. Download the VC.zip for Visual Studio or the mingw.tar.gz for Code::Blocks and MinGW.
  2. Create a folder called "libs" in each root project folder: "Particles/libs", "Cloth/libs", "RigidObject/libs" and "Fluids/libs".
  3. Put the next libraries in the previous folder: SDL2.dll, SDL2.lib, SDL2main.lib, glew32.dll and glew32.lib.
  4. Compile and run the solution in Debug-x64.

Authors


Samuel Balcells

Sergi Sánchez

License

MIT License