Welcome to FDF, a simple wireframe renderer developed in C using the mlx library.
Graphic programming involves creating visual content using programming languages. It encompasses a wide range of techniques for displaying images, animations, and graphical user interfaces (GUIs) on screens. This can include anything from simple shapes and lines to complex 3D renderings.
mlx (MiniLibX) is a simple X Windows graphic library created at 42 school. It provides a basic set of functions for creating graphical applications. mlx is particularly useful for projects involving simple 2D graphics, such as wireframe rendering, image manipulation, and basic GUI development.
- Wireframe Rendering/
Render 3D terrain as wireframe meshes. - Support for Various Map Formats
Accept input files in various formats, allowing users to visualize different terrains. - Color Mapping
Map different colors to terrain heights, providing visual cues for elevation changes. - Dynamic Camera Control
Allow users to navigate the terrain dynamically using keyboard controls, providing a flexible viewing experience. - Zoom and Rotation
Enable users to zoom in/out and rotate the view to inspect the terrain from different angles. - Adjustable Altitude
Provide functionality to adjust the altitude of the terrain, allowing users to focus on specific areas. - Menu provided
There is a menu giving information for everything how to use it, and real time information. - Error Handling
Implement robust error handling mechanisms to gracefully handle invalid input files or unexpected errors. - Performance Optimization
Optimize rendering performance to ensure smooth visualization even for large-scale terrains. - Cross-Platform Compatibility Ensure compatibility with MacOs and Linux.
- Modular Codebase
Structure the codebase in a modular fashion, making it easy to extend and maintain. - Documentation
Provide comprehensive documentation to guide users through installation, usage, and customization of the program. - Example Maps
Include a set of example maps to showcase the capabilities of the program and provide users with a starting point for exploration. - Integration with External Libraries Integrate with external libraries or APIs to extend functionality, in this case mlx library for mac and linux.
- For more check the subject
-
MiniLibX (mlx_linux) Library
The mlx library is required for graphical rendering and user interface functionalities on Linux. -
MiniLibX (mlx_mac) Library
The mlx library is required for graphical rendering and user interface functionalities on MacOS. -
libft Library
The libft library provides various utility functions commonly used in C programming. It was developed as part of this project. -
ft_printf Library
The ft_printf library is a custom implementation of the printf function for formatted output. It was developed as part of this project. -
get_next_line Function
The get_next_line function is a custom function that reads a line from a file descriptor. It was developed as part of this project. -
GNU Make
GNU Make is used to build the project from source code. It automates the compilation process using Makefiles. Make sure GNU Make is installed on your system.
To get started with FDF, follow these steps:
-
Clone the repository to your local machine.
-
Compile the program using the provided Makefile.
-
Run the executable with the desired input file.
git clone --recurse-submodules <repository-url> cd FDF make ./fdf test_maps/<map file>
We using git clone with submodules because im using the submodules I created from ft_printf and get_next_line
-
Rotation
Rotate images using the left mouse button, arrow keys, W, and Q. -
Moving
Move images using the right mouse button. -
Zooming in/out
Control zooming by scrolling the middle mouse button. -
Parallel Projection
Switch to parallel projection using the P key. -
Isometric Projection
Switch to isometric projection using the I key. -
Sphere Projection (Global Projection)
Switch to sphere projection using the G key. (Try map test_maps/march) -
Starry Background in Global Projection
Add stars to the background in global projection using the S key. -
Changing Colors
Change background or line colors using keys 1, 2, 3, and 4. -
Removing/Rendering Lines
Toggle line rendering using the L key. -
Removing/Rendering Dots
Toggle dot rendering using the D key.
- Spheric Projection
- Izometric Projection
![42](photos/Izometring projection.png)
- 2D projection
- Parallel projection
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
If you have any questions, feedback, or suggestions regarding this project, feel free to reach out to me via:
- Email: [email protected]
- GitHub: Vikingu-del
- LinkedIn: Erik Seferi
You can also open an issue on the project's GitHub repository for any bug reports or feature requests.