Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Wireframe model

NotificationsYou must be signed in to change notification settings

crigonza/Fdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fdf is a project at 42 that aims to create a graphical representation of a terrain in relief using the codanMLX42 library.

Fdf representation

Getting Started

To use this program, you need to clone this repository and compile it withmake bonus. This will generate an executable file:fdf.

Usage

To use this program in your own project, you need to provide a map file as an argument to thefdf program. The map file must contain a grid of numbers that represent the height of each point. For example:

0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  00  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  00  0 10 10  0  0 10 10  0  0  0 10 10 10 10 10  0  0  00  0 10 10  0  0 10 10  0  0  0  0  0  0  0 10 10  0  00  0 10 10  0  0 10 10  0  0  0  0  0  0  0 10 10  0  00  0 10 10 10 10 10 10  0  0  0  0 10 10 10 10  0  0  00  0  0 10 10 10 10 10  0  0  0 10 10  0  0  0  0  0  00  0  0  0  0  0 10 10  0  0  0 10 10  0  0  0  0  0  00  0  0  0  0  0 10 10  0  0  0 10 10 10 10 10 10  0  00  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  00  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0

The program will display the map in a window using a perspective projection and a color gradient according to the height of each point.

42 image

You can create your own maps with the .fdf extension or use the default maps that are in the /test_maps folder.

./fdf test_maps/t1.fdf

You can also interact with the map using the keyboard and mouse:

  • Use arrow keys to move the map
  • UseO andP keys to zoom in and out
  • UseQ andW keys to rotate the X axis
  • UseA andS keys to rotate the Y axis
  • UseZ andX keys to rotate the Z axis
  • UseSPACE to change perspective.
  • UseC key to change color.
  • UseESC key to exit the program

Requirements

The project has the following requirements:

  • The program must use the MLX42 library for graphical output
  • The program must use only basic functions from the standard C library (write, malloc, free, open, read, close)
  • The program must handle errors properly and not leak memory
  • The program must use a Makefile for compilation

[8]ページ先頭

©2009-2025 Movatter.jp