Welcome to the GraphToys project! This repository contains a collection of various graphical models and simulations, showcasing different aspects of computer graphics and simulation techniques.
You can build the project using either make
or CMake
. Both options are supported.
- Ensure you have either
make
orCMake
installed on your system. - Git should be installed for managing submodules.
- vulkan headers, vulkan libs, glslc, glfw3, freetype2
- Clone the Repository: First, clone this repository to your local machine using:
git clone https://github.com/resetius/graphtoys
- Initialize and Update Git Submodules: Before building, initialize and download the necessary git submodules:
git submodule init git submodule update
- Build the Project:
- Using
make
:make
- Using
CMake
:mkdir build cd build cmake .. make
- Using
After building, you can run the application using the following command:
./main.exe model_name --cfg config-file
Replace model_name
with the name of the model you want to run, and config-file
with the path to your configuration file if needed.
Here are the models you can explore in this project:
- torus: A simple rotating torus model.
- triangle: A basic triangle shape.
- mandelbrot: Visualization of the Mandelbrot set.
- mandelbulb: A 3D analog of the Mandelbrot set.
- stl: Loads a model in STL format from a file.
- particles: A particle model with calculations based on Newton's laws.
- particles2: A particle model using only vertex shaders for calculations.
- particles3: Particle model algorithms using PM and P3M.
- poisson: Solves the Poisson equation (no visualization).
- gltf: Loads a model in GLTF format.
- test: A simple test with rotating figures.
The configuration file for the GraphToys project uses the INI format, which is a simple, standard format for configuration files. The file is divided into sections, each marked by a header in square brackets ([]
). Here's a breakdown of the sections and parameters you can set:
This section is used to configure rendering settings.
-
api: Set the graphics API to be used. You can choose between
vulkan
andopengl
.api = vulkan
or
api = opengl
-
width: Define the width of the rendering window in pixels.
width = 800
-
height: Define the height of the rendering window in pixels.
height = 600
-
vsync: Set this to
on
oroff
to enable or disable vertical synchronization.vsync = on
or
vsync = off
Each model in the GraphToys project has its own dedicated section in the configuration file. The section name corresponds to the name of the model (for example, [torus]
, [triangle]
, etc.).
In these sections, you can specify various parameters that are unique to each model. It's recommended to refer to the source code in models/model_name.c
for detailed information on what parameters can be set for each specific model.
For example, if you're configuring the torus
model, you would look for parameters in the models/torus.c
file and set them in the [torus]
section of your configuration file.
Here's an example of what a configuration file might look like:
[render]
api = vulkan
width = 1024
height = 768
vsync = off
[torus]
; torus-specific settings
[triangle]
; triangle-specific settings
[mandelbrot]
; mandelbrot-specific settings
- Ensure the format and syntax are correctly followed to avoid any parsing errors.
- Since the parameters for each model can vary significantly, it's crucial to consult the source files for the correct options and their expected values.