Skip to content

The fifth project of 42 curriculum introduces students to the fundamentals of graphic programming with MiniLibX. Between three projects to pick out, I chose FdF which aims to represent "iron wire" meshing in 3D.

License

Notifications You must be signed in to change notification settings

ygor-sena/42cursus-FdF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OS Language Grade Status

📣 Introduction

The fifth project of 42 curriculum introduces students to the fundamentals of graphic programming with MiniLibX. This project is about representing a landscape as a 3D object in which all surfaces are outlined in lines. FdF is short for fil de fer in French which means wireframe model.

💭 Project diagram

Since the project in quite big, the diagram below helps to get an overview of the whole project. Each .c file has functions that can be global or static, which means respectively the functions in red and blue. As you can see, the core of the project corresponds to five files:

  • fdf.h: contains all the necessary functions and helpers to be called by the program.
  • instance.c: inicializes all variables necessary to render the map.
  • file.c: reads a file to get its dimension and coordinates values.
  • render.c: renders the map with minilibx once the file has been successfully read.
  • events.c: manages user events toggled by specific keys.

FdF_diagram

⚒️ How to compile and run the project

1) Copy this repository to your local workstation

git clone git@github.com:ygor-sena/42cursus-FdF.git

2) Compile the project with Makefile

make

3) Choose a map from folder maps to be rendered by the program

./fdf maps/10-2.fdf

You can also run make and a number between 1 and 21 as a shortkey to render the files in folder maps with valgrind to check for memory leaks. For example, the command below is equivalent to valgrind ./fdf maps/elem2.fdf. To see other commands with make, refer to Makefile.

make 11

💡 How to use the project

Key Command
Moves the map to left, up, down and right.
Esc Closes the program.
-+ Zooms the maps out and in.
ZX Increases and decreases map altitude.
O Renders the map in orthogonal projection.
I Renders the map in isometric projection.
AS Rotates the X axis of the map, i.e. roll rotation.
DF Rotates the Y axis of the map, i.e. pitch rotation.
GH Rotates the Z axis of the map, i.e. yaw rotation.
R Resets the map to its original state.

📖 References

About

The fifth project of 42 curriculum introduces students to the fundamentals of graphic programming with MiniLibX. Between three projects to pick out, I chose FdF which aims to represent "iron wire" meshing in 3D.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published