kkim의 cub3d 총정리 (미완)

 

목차 리스트

     

 

How to study 어떻게 공부할까?

공부 순서

저는 Pikuma 선생님의 강의를 듣고 Cub3D를 진행했습니다.

 

Raycasting Programming with C

Create a raycasting 3D scene using C programming language

courses.pikuma.com

 유료강의이며, javascript 무료 강의만 보라고 추천하시는 분들도 계셨지만,

 저는 유료 강의 전체를 들었습니다. (가격 25$)

 설명을 친절하게 잘 해주시고 질문-답변 커뮤니케이션 속도도 매우 빨라 굉장히 만족하였습니다.

 다만 한국어 자막 기능이 없어 100% 영어로 수강하여야 합니다.

 또 SDL이라는 라이브러리를 사용하시는데,

 mlx와는 거리가 꽤 있어 mlx를 공부하는 과정에서 결국 공부를 다시 하게 되는 감이 있습니다.

 

참고할 만한 자료

 
yeosong 님의 42wiki

cub3D

🖥 42 학습 노트 by yeosong

yeosong1.github.io

 
yechoi 님의 블로그

[42서울] cub3d 스텝 바이 스텝

cub3d는 레이캐스팅을 이용해 원시적인 일종의 3D 게임을 구현하는 과제다. 여기서 레이캐스팅이란 단어에서 짐작해보자면, 광선(ray)을 던져(cast) 현재 위치에서 벽(또는 장애물)이 충돌하는 지점

yechoi.tistory.com

 
heryu 님의 블로그

cub3d - mlx사용법 위주로 정리하기 (42seoul)

0. 프로젝트 목표 - 1인칭으로 3D 미로 표현하기 (그래픽 프로젝트) - 새로운 라이브러리 minilibx에 대해서 학습하기 - raycasting에 대해서 알고리즘으로 작성하기 - users.atw.hu/wolf3d/ 처럼 만들어보기 -

malbongcode.tistory.com

 

Cub3d 개념 공부

---

 

Check before test 시험 전에 확인하세요

Mandatory part 필수 파트

Executable name 실행 가능한 이름

 Check that the project compiles well without re-link,

 프로젝트가 리링크 없이 컴파일이 잘 되는지,

 

 when you excute the make command and that the executable name is cub3D.

 make 명령어로 실행했을때 만들어진 파일 이름이 cub3D인지 확인하세요.

file name : cub3D
  no problem with compile && make

 

Configuration file 파일 구성

 Check that you can configure ALL the following elements in the configuration file.

 파일 구성에 있어서 아래에 나오는 모든 요소들을 구성할 수 있는지 확인하세요.

 

 The formatting has to be as described in the subject.

 형식은 서브젝트에 설명된 대로 구성되어야 합니다.

 

R : the image resolution / window size
NO : north texture path
EA : east texture path
SO : east texture path
WE : east texture path
S : sprite texture path
F : floor color
C : celling color
Map : see subject for the map configuraation details.

 

 Also check that the program returns an error and exits properly when the configuration file is misconfigured (for example an unknow key, double keys, an invalid path..) or if the filename doesn't end with the .cub extension.

 프로그램이 잘못된 상황에서 파일 구성이 잘못되었거나(예를 들자면 찾지 못하는 키, 중복된 키, 잘못된 경로, 등등등) 파일이 .cub가 아닐 경우 에러를 출력하는지 확인하세요.

 

 If not, the defence is over and the final grade will be 0.

 아니라면, 최종점수 0점!!

 

Technical elements of the display 화면 출력에 대한 기술적 요소들

 We're going to evaluate the technical elements of the display.

 지금부터 화면에 표시되는 기술적인 요소들을 평가할 것입니다.

 

 Run the program and execute the 5 following tests.

 프로그램을 실행하고, 밑의 5가지 테스트를 실행하세요.

 

 If at least one fails, no points will be awarded for this section.

 만약 하나라도 실패한다면, 이 섹션에서 점수를 받을 수 없습니다.

 

더보기

 A windows must open at the launch of the program if the --save argument is not supplied.

 --save 옵션이 없다면 프로그램을 실행할 때 화면이 열려야 합니다.

 

 It must stay open during the whole execution

 and have the resolution as set in the configuration file.

 cub3D는 전부 실행하는 동안 화면이 열려 있어야 하며, 구성 파일에 설정된 해상도를 가져야만 합니다.

 

 An image representing the inside of a maze must be displayed inside the window.

 미로의 내부를 나타내는 이미지가 창 안에 표시되어야합니다.

 

 When the argument --save is supplied,

 the program won't open a window but output a file in bmp format

 --save 옵션이 있다면 프로그램은 창을 열지 않고 .bmp 형식의 파일을 출력합니다..

 with the resolution as defined in the configuration file (R key).

 물론 .cub 구성 파일의 R 키에 적힌 해상도대로 출력되어야 합니다.

 Note that a subprocess opening up in the dock is not the same as a window.

 하단부 Dock에 열리는 하위 프로세스는 창과 동일하지 않습니다. (?)

 

 Hide all or part of the window either by using another window

 or by using the screen's borders, then minimize the windows and maximize it back.

 프로그램 화면의 전체를 다른 창으로 가려 보세요. 그 다음 최소화 시켜보세요.

 In all cases the content of the window must remain consistent.

 모든 과정을 거칠 때 화면의 내용이 일관성 있게 유지되어야 합니다.

 

 Set a resolution (R key) in the config file greater than the actual screen resolution.

 .cub 구성 파일의 R 키에 적힌 해상도를 실제 화면보다 크게 설정해 보세요.

 The program must resize the window to fit the screen resolution.

 프로그램은 전체 화면에 딱 맞게 구성되어야 합니다.

 

User basic events 유저 기본 이벤트

 In this section we're going to evaluate the program's user generated events.

 이번 섹션에서는 사용자 생성 이벤트를 평가할 것입니다.

 Execute the 3 following tests.

 아래의 3가지 테스트를 실행해 보세요.

 If at least one fails, this means that no points will be awarded for this section.

 하나라도 실패한다면, 이 섹션에서 점수를 얻을 수 없습니다.

 

더보기

 Click the red cross at the top left of the window.

 The window must close and the program must exit cleanly.

 화면 상단의 빨간 X 버튼을 누르세요. 깔끔하게 종료되어야 합니다!

 

 Press the ESC key. The window must close and the program must exit cleanly.

 In the case of this test, we will accept that another key exits the program, for example Q.

 ESC 버튼을 누르세요. 깔끔하게 종료되어야 합니다!

 (ESC 키가 아닌 다른 키도 허용됩니다. ex: Q)

 

 Press the four arrow keys (we'll accept WASD or ZQSD keys) in the order of your liking.

 Each keypress must render a visible result on the window, such as a player's movement/rotation.

 4개의 방향키(WASD나 ZQSD도 허용)를 원하는 대로 눌러보세요.

 각각의 입력은 시각적인 변화를 불러일으켜야 합니다. 플레이어 움직임이나 회전 등과 같이요.

 

Movements 움직임

 In this section we'll evaluate

 the implementation of player's movement/orientation inside the maze.

 이번 섹션에서는 미로 안에서의 플레이어 움직임 구현을 평가할 것입니다.

 Execute the 5 following tests.

 아래의 다섯 개 테스트를 실행하세요.

 If at least one fails, this means that no points will be awarded for this section.

 하나라도 실패한다면, 이 섹션에서 점수를 얻을 수 없습니다.

 

더보기

 The player's spawning orientation on the first image

 must be in accordance with the configuration file, test for each cardinal orientation (N, S, E, W).

 첫 번째 이미지에서 플레이어의 스폰 방향은 구성 파일에 따라야하며 각 4방향 (N, S, E, W)에 대해 테스트해야합니다.

 

 Press the left arrow (or A or Q) then the right arrow (or D).

 The player's view must rotate to the left then to the right as if the player’s head was moving.

 왼쪽 방향키(또는 A 또는 Q)를 누르고 오른쪽 방향키(또는 D)를 누르세요.

 플레이어의 시야는 머리가 움직이듯이 왼쪽으로, 또 오른쪽으로 움직여야 합니다.

 

 Press the up arrow (or W or Z) then the down arrow (or S).

 The player's view must go forward and then backward in a straight line.

 앞 방향키 (또는 W 또는 Z)를 누르고 뒤 방향키 (또는 S)를 누르세요.

 플레이어의 시야는 직선으로 앞/뒤로 움직여야 합니다.

 

 Press A or Q (or the left arrow) then D (or the right arrow).

 The player's view must go to the left and then to the right in a straight line.

 A 또는 Q (또는 왼쪽 화살표)를 누르고 D (또는 오른쪽 화살표)를 누르세요.

 플레이어의 시야는 직선으로 왼쪽/오른쪽으로 움직여야 합니다.

 

 During those four movements, was the display "smooth"?

 By "smooth" we mean is the game playable or is it low.

 네 가지 테스트 동안 움직임이 "부드러웠나요"?

 "부드럽다"는 말은 게임이 플레이 가능한 정도여야 한다는 뜻입니다.

 

Walls & Sprites 벽과 사물들

 In this section we'll evaluate the walls and sprites implementation in the maze.

 이번 섹션에서는 미로 안에서의 벽과 사물 구현을 평가할 것입니다..

 Execute the 5 following tests.

 아래의 다섯 개 테스트를 실행하세요.

 If at least one fails, this means that no points will be awarded for this section.

 하나라도 실패한다면, 이 섹션에서 점수를 얻을 수 없습니다.

 

더보기

 The walls texture vary depending on which compass point the wall is facing (north, south, east, west).

 벽 텍스처는 방향(동, 서, 남, 북)에 따라 결정되어야 합니다.

 Check that the textures on the walls and perspective are clearly visible and correct.

 벽의 질감 등이 명확하게 보이는지 확인하세요!

 

 Check that if you modify the path of a wall texture or sprite image in the configuration file,

 it actually modifies the rendered texture or sprite when the program is re-executed.

 .cub 구성 파일의 벽 텍스처나 스프라이트 이미지의 경로를 수정한다면 재실행 시에 알맞게 변환되는지 확인하세요.

 

 Also check that if you set a non-existant path it raises an error.

 물론 존재하지 않는 파일/경로를 넣었을 때 에러를 출력하는지도 확인하시구요!

 

 Check that the sprite is displayed correctly and that it can be present multiple times in the same map.

 사물이 올바르게 표시되고 동일한 맵에 여러 번 나타날 수 있는지 확인합니다.

 

Error management 에러 관리

 In this section, we’ll evaluate the program's error management and reliability.

 이번 섹션에서는 프로그램의 신뢰성과 에러 관리에 대해 평가할 것입니다.

 Execute the 4 following tests.

 아래의 네 개의 테스트를 실행하세요.

 If at least one fails, this means that no points will be awarded for this section.

 하나라도 실패한다면, 이 섹션에서 점수를 얻을 수 없습니다.

 

더보기

 Run the program using numerous arguments and random values.

 수많은 인수들과 무작위 값을 넣어서 실행시켜 보세요.

 Even if the program doesn't require any arguments,

 it is critical that those arguments don't alternate or create unhandled errors.

 만약 프로그램이 아무 인수도 필요로 하지 않는다면, 이것은 수많은 에러를 생성할 수 있기에 치명적인 것입니다.

 

 Check that there are no memory leaks.

 메모리 누수가 없는자 확인하세요.

 You can use the [top] or [leaks] command in another shell to monitor that the memory use is stable.

 다른 쉘을 열어 [top] 또는 [leaks] 명령어를 사용하면 확인할 수 있습니다.

 The memory used must not increase each time an action is made.

 사용 된 메모리는 작업이 수행 될 때마다 증가하지 않아야 합니다.

 

 Roll either your arm or your face on the keyboard.

 팔이나 얼굴을 키보드 위에서 굴리세요. (??????? 그냥 막 누르라는 뜻인듯)

 The program must not show any strange behaviors and it must stay functional.

 프로그램은 이상한 행동 없이 기능적으로 유지되어야 합니다.

 

 Modify the map.

 맵을 수정해 보세요.

 The program must not show any strange behaviorsand it must stay functional

 if the map is well configured, if not it must raise an error.

 맵이 잘 구성되어 있다면 프로그램은 이상한 행동을 보이지 않고 기능적으로 유지되어야 합니다. 아니라면 에러를 출력하세요.

 

Bonus 보너스

 We will look at your bonuses if and only if your mandatory part is excellent.

 기본 파트가 완벽할 때만 보너스를 확인할 것입니다.

 

 This means that you must complete the mandatory part, beginning to end,

 and your error management must be flawless, even in cases of twisted or bad usage.

 즉, 처음부터 끝까지 필수 부분을 완료해야하며 뒤틀리거나 잘못된 사용의 경우에도 오류 관리가 완벽해야 합니다.

 

 So if the mandatory part didn't score all the point

 during this defence bonuses will be totally ignored.

 그러니까 만약 기본 파트의 점수가 잘못된다면 보너스는 완전히 무시될 겁니다.

 

더보기

 보너스 항목은 총 18개입니다. 14개 이상이면 15점 만점을 받을 수 있습니다.

 

 1. 벽 충돌

 2. 스카이박스

 3. 바닥/천장 텍스쳐

 4. HUD

 5. 위 아래 보기 기능

 6. 점프/웅크리기

 7. 거리에 따른 그림자 효과

 8. 생명 바

 9. 많은 아이템

 10. 물체 충돌

 11. 물체/트랩을 주웁으로써 포인트 획득/생명력 감소

 12. 여닫이문

 13. 비밀 문

 14. 총 발사 애니메이션/아이템 애니메이션

 15. 레벨

 16. 사운드이펙트, 배경음악

 17. 마우스 시점 전환

 18. 무기와 빌런 (싸움 기능)