t2_3.mp4
This project is about creating a wireframe model representation of a 3D landscape by linking points (x, y, z) via line segments (edges). These edges are constructed though Bresenham's line algorithm for continuity and draw to the screen with a isometric view which make it feel an 3D object in space.
Main objectives
- Represent the object statically;
- Add rotation around an axis;
- Add translation across the plane;
- Add height increase and decrease;
- Add zoom in and zoom out;
- Add top view angle;
- Draw lines with a color gradient;
Future features
- Rotation around arbitrary axis;
- Object centralization when changing perspective or zoom;
- GUI sidebar;
- Toggle buttons;
- Interactive mode with mouse;
- Map Parsing: Reads and parses
.fdffiles, which define coordinates (x, y) and altitude (z). - Isometric Projection: Renders the wireframe model using an isometric projection.
- Graphic Management: Displays the image in a window using the MiniLibX library.
- Event Handling: The program must close the window and quit cleanly when the
ESCkey is pressed or when the window's frame cross is clicked.
This implementation includes several bonus features to enhance the model viewer:
- Additional Projections: A parallel (top-down) view is included.
- Zoom: Users can zoom in and out of the model.
- Translation: The model can be translated (moved) across the X and Y axes.
- Rotation: The model can be rotated around its central axes.
- Altitude Control: The Z-axis scaling (altitude) can be increased or decreased dynamically.
- Color Gradient: Lines are drawn with a color gradient based on their altitude.
The MiniLibX library requires several dependencies. You can install them using:
sudo apt-get update && sudo apt-get install xorg libxext-dev zlib1g-dev libbsd-devThis project also uses libft, which is included as a submodule and compiled automatically by the Makefile.
Clone the repository and compile the project using make:
git clone [https://github.com/RafaelyRezende/FilDeFer.git](https://github.com/RafaelyRezende/FilDeFer.git)
cd FilDeFer
make bonusMakefile Rules:
all: Compiles the mandatory part (fdf).bonus: Compiles the bonus part (fdf).clean: Removes object files.fclean: Removes object files and the final executable.re: Cleans and recompiles the project.
Execute the program by passing a valid .fdf map file as an argument:
./fdf test_maps/42.fdf- PYRA MAP
- AMAZON RAINFOREST
NOTE: Custom map files generated using this repository, authored by Jean-Michel Gigault.
This project was completed using only the functions authorized by the subject:
openclosereadwritemallocfreeperrorstrerrorexitgettimeofday- All functions from the Math Library (
-lm) - All functions from the MiniLibX library