본문 바로가기
개인프로젝트/완성

Determine polygon collision: 다각형 충돌 판정

by 할거없네 2018. 8. 8.


If you make a polygon by taking several points

Determines if a circle has collided with a polygon.


점을 여러개 찍어서 다각형을 만들면

동그라미가 다각형과 충돌했는지 판정합니다.




To create such a program, the following process is performed.
이와 같은 프로그램을 짜기 위해서 다음과 같은 과정을 거칩니다.

1. 두 점의 직선 방정식

2. 원과 직선과의 수직 방정식

3. 구해진 방정식의 교차점

4. 교차점과 원과의 거리 계산

5. 교차점의 위치 확인(사이에 있는지?)

6. 선분의 개수만큼 반복


1. Linear equation of two points

2. Vertical equation between circle and straight line

3. The intersection of the obtained equation

4. Calculate distance between intersection and circle

5. Checking the position of the intersection (between?)

6. Repeat as many as the number of segments



https://scratch.mit.edu/projects/238503870/

'개인프로젝트 > 완성' 카테고리의 다른 글

미완성-수집형 카드게임(데챠 모방)  (2) 2017.10.28
미완성- 온라인 게임 도전  (0) 2017.10.28
개인 프로젝트-격투게임  (0) 2017.10.28
완성-방치우기 게임  (0) 2017.10.28

댓글