Run(56)
-
[Computer Graphics] Viewing
- 3D shape에는 Viewing, Lighting, Texture가 더해져야 한다. - 이전까지 transformation(이동, 크기 변환, 회전 등)을 했다면, Viewing을 통해 카메라를 설정해보자. - Model-view Transformation은 Transformation 파트에서 진행한 부분이고, Viewing 파트에서는 Projection Transformation을 다룬다. - Projection: Taking 3D information and collapsing it to 2D using an eye or camera. Two Types of Projections - 1) Parallel Projection: Projectors are parallel. The lines spec..
2023.10.10 -
[Etc] LaTeX/Overleaf 사용팁
1. 글 다음줄로 넘기기 // 2. 들여쓰기 제거 \noindent 3. 이미지 \begin{figure}[htb!] \caption{캡션 내용} \centerline{\includegraphics[width=너비cm]{이미지경로}} \end{figure} \begin{figure*}[htb!] \centering \caption{캡션 내용} \subfigure{\includegraphics[width=이미지1너비cm]{이미지1경로}} \subfigure{\includegraphics[width=이미지2너비]{이미지2경로}} \end{figure*} 4. 표 https://www.tablesgenerator.com/ - 이 사이트에서 쉽게 생성할 수 있다. 5. 수식 (예시) $$ P(40) = \fra..
2023.10.10 -
[Computer Grpahics] WebGL Variables
Variable Types - bool: boolean - int: signed integer - float: floating point scalar - vec2, vec3, vec4: n-dimensional float vector - bvec2, bvec3, bvec4: n-dimensional boolean vector - ivec2, ivec3, ivec4: n-dimensional integer vector - mat2, mat3, mat4: 2x2, 3x3, 4x4 float matrix - sampler2D: access a 2D texture - samplerCube: access a cube mapped texture Kind of Variables Vertex Shader (VS) Ja..
2023.10.10 -
[Etc] RSA decryption
Extended Euclidean Algorithm, Chinese Remainder Theorem, Fermat's Little Theorem 을 이용하여 RSA decryption 을 진행해보자. 주어진 조건 - n = 2491 - C = 1644 (mod 2491) - e는 최대한 작은 홀수 - p < q 풀이 과정 1) p, q 계산 2) φ 계산 3) e, d 계산 - Extended Euclidean Algorithm (Pulverizer of Aryabhata) 4) M (mod p), M (mod q) 계산 - Fermat's Little Theorem 5) M (mod n) 계산 - Chinese Remainder Theorem, Extended Euclidean Algorithm 1) ..
2023.10.10 -
[Image Understanding] Color Image 생성하기
Red + Green = Yellow Red + Blue = Magenta Green + Blue = Cyan img1 = zeros(500, 500, 3); img1(50:300, 50:300, 1:2) = 255; img1(250:450, 250:450, 2:3) = 255; figure(1), imshow(img1); zeros()를 통해 500x500 크기의 검정색 이미지를 생성했다. x 좌표가 50~300인 곳, y 좌표가 50~300인 부분은 1(Red), 2(Green) 값을 255(0~255)로 설정하였다. Red와 Green을 섞으면 Yellow이므로, 해당 부분은 Yellow를 띠게 된다. x 좌표가 250~450인 곳, y 좌표가 250~450인 부분은 2(Green), 3(Blue)..
2023.10.10 -
[Computer Graphics] WebGL 다각형 그리기
WebGL에서 다각형(사각형, 오각형, ...)은 여러 삼각형들이 합쳐진 형태로 그려낼 수 있다. 삼각형을 붙이는 방법에는 LINE_STRIP, LINE_LOOP, TRIANGLE_FAN, TRIANGLE_STRIP이 있다. 차례대로 사용해보며 각각이 어떻게 동작하는지 알아보고자 한다. 먼저 html 코드는 아래와 같다. 이전 글에선 drawTriangle() 함수를 실행시키도록 하고 해당 함수 내에서 모든 작업을 진행했으나, 하나의 캔버스에 여러 도형을 그리는 경우 각각의 도형을 그리는 함수를 따로 두어 코드를 간결하게 만들었다. JS 코드는 아래와 같다. 먼저 LINE_STRIP을 사용해보았다. var canvas; var gl; var squareProgram function init() { can..
2023.10.10