Search
Duplicate

Problem (1)

Goals

이 과제의 목적은 C 언어를 사용하고, 기본 알고리즘을 사용하고, 정보를 탐색하는 것입니다.
cub3D는 윈도우, 색, 이벤트를 다루는 것을 알려주며 모양을 채우는 기술을 향상시킵니다.
cub3D는 구체적인 내용을 이해하지 않고도 수학의 놀이적인 실용적인 응용을 탐구하기에 탁월합니다.
인터넷에서 많이 제공되는 문서를 활용하여, 수학을 도구로 사용하여 우아하고 효율적인 알고리즘을 만들 수 있습니다.

Mandatory part - cub3D

program name: cub3D
Turn in files: All your files
Makefile: all, clean, fclean, re, bonus
Arguments: a map in format *.cub
External functs:
open, close, read, write, printf, malloc, free, perror, strerror, exit
All functions of the math library (-lm man man 3 math)
All functions of the MLX
Libft authorized: Yes
Description: You must create a “realistic” 3D graphical representation of the inside of maze from a first-person perspective. You have to create this representation using the Ray-Casting principles mentioned earier.

The constraints

Use the MLX.
The management of your window must remain smooth.: changing to another window, minimizing, etc.
Display different wall textures that vary depending on which side is facing (N, S, E, W)
Your program must be able to set the floor and ceiling colors to two different ones.
The program displays the image in a window and respects the following rules:
The left and right arrow keys of the keyboard must allow you to look left and right in the maze.
The W, A, S, and D keys must allow you to move point of view through the maze.
Pressing ESC must close the window and quit the program cleanly.
Cliking on the red cross on the window’s frame must close the window and quit the progra cleanly.
The use of images of the MLX is strongly recommended.
Your program must take as a first argument a scene description file with the .cub extension.
The map must be composed of only 6 possible characters: 0 for an empty space, 1 for a wall, and N,S,E,W for the player’s start position and spawning orientation.
The map must be closed/surrounded by walls, if not the program must return an error.
Excepts for the map content, each type of element can be sepereated by one or more empty lines.
Excecpt for the map content which always has to ble the last, each type of element can be set in any order in the file.
Except for the map, each type information from an element can be seperated by one or more space.
The map must be parsed as it looks in the file. Spaces are a valid part of the map and are up to you to handle. You must be able to parse any kind of map, as long as it respects the rules of the map.
Each element (execpt the map) firsts information is the type of identifier (composed by one or two character), followed by all specific informations for each object in a strict order such as:
North texture: NO ./path_to_north_texture
identifier: NO
path to the north texture
South texture: SO ./path_to_south_texture
identifier: SO
path to south texture
West texture: WE ./path_to_west_texture
identifier: WE
path to west texture
Eest texture: WE ./path_to_east_texture
identifier: EA
path to east texture
Floor color: F 220,100,0
identifier: F
R, G, B colors in range [0, 255]: 0, 255, 255
Ceiling color: C 255, 30, 0
identifier: C
R, G, B colors in range [0. 255]: 0, 255, 255
If any misconfiguration of any kind os encountered in the file, the program must exit properly and return “Error\n” folloed by an explicit error message of your choice.

Bonus part

!Bounuses will be evaluated only if your mandatory part is PERFECT. By PERFECT we naturally mean that it needs to be complete, taht it cannot fail, even in cases of nasty mistakes like wrong uses etc. It means that if your mandatory part does not obtain ALL the points during the grading, your bonuses will be entirely IGNORED.
Bouns list:
Wall collisions.
A minimap system.
Door which can open and close.
animated sprite.
Rotate the point of view with the mouse.
You will be able to create better games later do not waste too much time!
You are allowed to use other functions or add symbols on the map to complete the bonus part as long as their use is justified during your evaluation. You are also allowed to modify the expected scene file format to fit your needs. Be smart!