Wireframe rasterizer.
- Status: finished
- Result: 125%
- Observations: you can zoom, translate (move) and rotate the wireframe :D
git clone --recurse-submodules https://github.com/izenynn/fdf.git
- If you are using Linux, firts you will need to install a few dependencies
sudo apt-get update && sudo apt-get install xorg libxext-dev zlib1g-dev libbsd-dev
- Also, give execution permissions to the file
./lib/mlx_linux/configure
chmod +x ./lib/mlx_linux/configure
Open the Makefile
, go to line 40 and change WIN_H value to you desire windows height, and WIN_W value to the window width :)
- For Full HD example:
CCFLAGS += -D WIN_H=1080 -D WIN_W=1920
A custom palette will be aplied when no colors are present on the map, the color will depend on the z axis, to change this palette, uncomment line 57 - 61 in the Makefile
and change the color values, example:
DCOLORS = -D COLOR_1=0x00a0b0 \
-D COLOR_2=0x4f372d \
-D COLOR_3=0xcc2a36 \
-D COLOR_4=0xeb6841 \
-D COLOR_5=0xedc951
- Run
make
(make rules:all
,clean
,fclean
andre
)
make all clean
- Run
./fdf
with a map as an argument (test maps on thetest_maps
folder)
./fdf ./test_map/42.fdf
I do not know for sure if this bug is related with minilibx, linux, or wsl.
This is because of ESC key ghosting. to fix this comment the lines that close the program when ESC key is pressed.
Go to src/mlx_hook.c
and comment line 25 and 26:
//if (keycode == KEY_ESC)
// close_win(vars);
You will stil be able to exit either closing the window or by pressing CTRL + C on the terminal.
If you have any issues on MAC OS, an alternative minilibx is included in the repo, just uncomment the lines 108 and 109, and comment lines 111 and 112 of the Makefile
:)
- Before
ifeq ($(UNAME_S),Darwin)
CFLAGS += -D OSX
# ########## SHARED VARS ##########
CCFLAGS += -framework OpenGL -framework AppKit
LDLIBS = -lft -lmlx
# ########## mlx_mms ##########
# LMLX_NAME = $(LMLX_NAME_MMS)
# LMLX_DIR = $(LMLX_DIR_MMS)
# ########## mlx_macos_sierra ##########
LMLX_NAME = $(LMLX_NAME_MACOS_SIERRA)
LMLX_DIR = $(LMLX_DIR_MACOS_SIERRA)
endif
- After
ifeq ($(UNAME_S),Darwin)
CFLAGS += -D OSX
# ########## SHARED VARS ##########
CCFLAGS += -framework OpenGL -framework AppKit
LDLIBS = -lft -lmlx
# ########## mlx_mms ##########
LMLX_NAME = $(LMLX_NAME_MMS)
LMLX_DIR = $(LMLX_DIR_MMS)
# ########## mlx_macos_sierra ##########
# LMLX_NAME = $(LMLX_NAME_MACOS_SIERRA)
# LMLX_DIR = $(LMLX_DIR_MACOS_SIERRA)
endif
-
documentation (by qst0)
-
fdf mini wiki (by VBrazhnik)