FdF is a project from 42 School that challenges you to create a 3D wireframe visualization of a landscape based on elevation data. This project will help you delve into graphics programming, matrix transformations, and interactive user input handling.
The fdf project involves reading a map file containing elevation data and displaying its 3D wireframe model. Using a simple graphics library, you will render the landscape and provide interactive controls for navigation such as zoom, rotation, and translation.
- 3D Rendering: Visualize a wireframe model of a 3D landscape.
- Interactive Navigation: Rotate, zoom, and pan the view using keyboard and/or mouse inputs.
- Data Parsing: Efficiently read and process elevation data from map files.
- Optimized Performance: Designed to render scenes in real time with minimal delay.
- C Compiler (e.g.,
gcc
) - Make (for building the project)
- MiniLibX: A lightweight graphics library used at 42.
- Unix-based Operating System: Linux or macOS.
- Clone the repository:
git clone https://github.com/tigran-sargsyan-w/FdF.git
- Navigate to the project directory:
cd FdF
- Compile the project using Make:
This will compile the
make
fdf
executable.
Run the program by providing a map file as an argument:
./fdf maps/42.fdf
The program will open a window displaying the 3D wireframe of the provided map. Use the keyboard and mouse to navigate through the landscape.
-
Input Parsing:
The program reads the input map file and parses the elevation data. -
Matrix Transformation:
The elevation data is transformed into a 3D model using matrix operations. -
Rendering:
The 3D wireframe is rendered using the MiniLibX graphics library. -
User Interaction:
Interactive controls allow you to rotate, zoom, and pan the view. -
Output:
The final output is a dynamically rendered 3D visualization of the landscape.
The repository includes several test maps and a testing script to verify the functionality of fdf.
Execute the testing script to run all test cases:
./tester.sh
The script will validate:
- Proper parsing of map files.
- Accurate 3D rendering.
- Responsiveness of interactive controls.
- Memory management and performance.
- MiniLibX Installation: Ensure that MiniLibX is correctly installed and configured on your system.
- Map File Format: Verify that your map files follow the expected format.
- Memory Leaks: Use tools such as Valgrind to detect any memory leaks or errors.