Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shimazadeh/fdf
https://github.com/shimazadeh/fdf
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/shimazadeh/fdf
- Owner: shimazadeh
- Created: 2022-07-08T12:17:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-26T17:50:42.000Z (over 2 years ago)
- Last Synced: 2023-03-06T08:15:59.668Z (almost 2 years ago)
- Language: C
- Size: 662 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FDF | 3D Wireframe Viewer | 42Paris
## Introduction
The program takes a 2D map as a parameter and creates its 3D projection. The column is the x, the line is the y and the value is the z.## Implementation
Here is a summary of how the overal program works:
- Parsing: the map which is presented as a file is read line by line and the values are parsed and stored into the following data structure where x, y, z and color values are the directly taken from the map:
- typedef struct s_array{
double x;
double y;
double z;
int color;
int x_screen;
int y_screen;
int max_color;
} t_array;
- Then matrix-vector multiplication of the x, y and z with the rotation matrix is used to calculate the x_screen and y_screen at every point. For this application we chose to initialize the rotation matrix to: roll = 0.523599, pitch = -0.523599, yaw = 0.523599. you can modify these angles accordingly they will represent the first view of the map.
- Bresenham's Line Drawing Algorithm is used to draw lines between every two points.
- Hooks:
- Rotation: You can rotate the view using the keys D (roll -), A (roll +), W (picth +), X (pitch -), Z (yaw -), and E (yaw +).
- Zoom: Zoom in and out of the map as needed.
- Altitude Adjustment: Fine-tune the altitude scale coefficient using the up and down arrow keys.
- Color Variation: The map's colors dynamically change based on its altitude.## Usage
One of the requirement of this project was to use 42l's minilibX.
- This project is designed to work with minilibx for linux version make sure you have the minilibx-linux version in the repo.
- git clone https://github.com/shimazadeh/FDF.git FDF
- cd FDF
- make
- ./fdf maps/test_maps/map.fdf## Showcase
https://github.com/shimazadeh/FDF/assets/67879533/9d9998dd-ce92-486d-a6c3-0df45a85bd21
### Render large map with millions of points
### Render maps with different color scheme
***Explore more by using the maps in the map directory of the repo!***