An open API service indexing awesome lists of open source software.

https://github.com/link-wolf/fdf

42 project - Program for wireframe modeling from a given file
https://github.com/link-wolf/fdf

42 42born2code 42school c macos

Last synced: 2 months ago
JSON representation

42 project - Program for wireframe modeling from a given file

Awesome Lists containing this project

README

          


Link-Wolf - FdF
42 grade - 125 / 100
Year - 2022
stars - FdF
forks - FdF
issues - FdF
OS - macOS





Logo

FdF


U said wire ?

Wireframe modeling




Report Bug
·
Request Feature


Table of Contents



  1. About The Project


  2. Getting Started


  3. Usage

  4. Roadmap

  5. Contributing

  6. Contact

## About The Project



FdF header

This project consists of graphically creating the schematic representation
of raised terrain
The program takes a file `.fdf` as a parameter and show the 3D representation of the file content
To do this, we're allowed to use our [libft](https://github.com/Link-Wolf/libft), [get next line](https://github.com/Link-Wolf/get_next_line), the C `math` library, and a tiny local graphic library : the [minilibx](https://harm-smits.github.io/42docs/libs/minilibx/introduction.html) (also called mlx)

- The file contains `n` lines with the same size
- The file must contain only integers, separated by space
- Each integer represents the altitude of the related point
- Each point must be joined to the 2 / 3 / 4 others around it

This is an example of a valid file
```
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 0 0 1 1 0 0 0 1 1 1 1 1 0 0 0
0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0
0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0
0 0 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0
0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0
0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 0
0 0 0 0 0 0 1 1 0 0 0 1 1 1 1 1 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
```

We have to render the result in an isometric projection and be able to close the window either by the red cross or by press `ESC`

### Bonus features

- Include an additional projection (you can switch by pressing `TAB`)
- Implement zoom in and out (scroll wheel)
- Implement translation (press `WASD`)
- Implement at least one rotation (I added all of them by pressing `JL`/`IK`/`UO`)
- Add an additional bonus of my choice. I added colors for the wireframe when the map is big enough. The next picture is an illustration of it with a big, big map



FdF header

(back to top)

## Getting Started

It's a simple C program but
/!\\ sadly the mlx used is only available locally on 42 iMacs /!\\
**However** you can use the [improved one](https://github.com/codam-coding-college/MLX42), it will *just* need to edit some includes, the [Makefile](https://github.com/Link-Wolf/FdF/blob/master/Makefile) and maybe some other little things

### Prerequisites

Having a C compiler like cc, gcc or clang
Be on a 42 iMac or get the MLX42 described above

### Installation
Assuming you are on a 42 iMac
If you use the MLX42, use its [documentation](https://github.com/codam-coding-college/MLX42)
1. Clone the repo
```sh
git clone https://github.com/Link-Wolf/FdF.git
```
2. Compile FdF
```sh
cd FdF; make
```
3. Execute the program with a `.fdf` file
```sh
./fdf [your file].fdf
```

(back to top)

## Usage

Test this FdF with any map you want !
The first picture is the result from this command :
```sh
./fdf 42.fdf
```

*(You can find some example [maps](https://github.com/Link-Wolf/FdF/tree/master/maps) in the maps folder)*

(back to top)

## Roadmap

- [x] Add all bonus features
- [x] Add some examples maps
- [x] Add back to top links

See the [open issues](https://github.com/Link-Wolf/FdF/issues) for a full list of proposed features (and known issues).

(back to top)

## Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

(back to top)

## Contact

Mail : xxxxxxx@student.42mulhouse.fr

Project Link: [https://github.com/Link-Wolf/FdF](https://github.com/Link-Wolf/FdF)

(back to top)