Skip to content

firstimedeveloper/fdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fdf

42 graphics project

This is an intro to graphics project done at 42 Seoul using the minilibx graphics libriary.

This program outputs an isometric projection of a 3d 'mesh' map given an input of a text file with a .fdf file extension (it's a plain old text file).

In the textfile, there is a grid of numbers. The position of the numbers corresponds to the (x, y) position and the numbers themselves corresponds to the z-axis.

For example:

input:

$cat test_maps/42.fdf
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 10 10  0  0 10 10  0  0  0 10 10 10 10 10  0  0  0
0  0 10 10  0  0 10 10  0  0  0  0  0  0  0 10 10  0  0
0  0 10 10  0  0 10 10  0  0  0  0  0  0  0 10 10  0  0
0  0 10 10 10 10 10 10  0  0  0  0 10 10 10 10  0  0  0
0  0  0 10 10 10 10 10  0  0  0 10 10  0  0  0  0  0  0
0  0  0  0  0  0 10 10  0  0  0 10 10  0  0  0  0  0  0
0  0  0  0  0  0 10 10  0  0  0 10 10 10 10 10 10  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

output:

The program:

make

# ./fdf [path_to_fdf_file_containing_map_information]
./fdf test_maps/pyramide.fdf

As a bonus

Using the WASD keys will move the camera,

  • -/+ keys will zoom in and out,
  • </> keys will amplify the z-axis (the numbers in the text file)
  • Q/E, LEFT/RIGHT, UP/DOWN keys will rotate the image along the x,y,z axis
  • The r key will toggle between isometric and parallel projection
Screen.Recording.2022-12-05.at.7.04.39.PM.mov

About

42 graphics project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published