Run/Computer Graphics(15)
-
[Computer Graphics] Curves & Surfaces
- 이전까지는 직선으로만 도형을 형성했다. - Curves, Sufaces는 디자인 측면에서 중요하다. - Curves: 1D objects in 2D or 3D space - Surfaces: 2D objects in 3D space 곡선을 나타내는 방법 Polynomials n: degree / a0, a1, ... an: constants Drawing Polynomials Using Control Points - point들을 Control Points 라고 한다. - 위 그림에는 총 21개의 point가 있다. → degree 20 polynomial (20차 방정식) 사용 (ex. 일차방정식 y = ax + b 를 표현하려면 점 2개가 필요하다.) - 이 방식을 사용하면 high degree ..
2023.10.10 -
[Computer Graphics] Reflection Mapping
- Shiny objects reflect the entire surrounding. Cube Map - Back face, Left face, Right face, Top face, Bottom face, Front face(behind camera) - The cube is textured mapped with the environment. - Each point on the cube acts like a light source. (∵ it could be either a real source of light, or an element that reflects light) - Point lies on the face. - Cube is assumed to lie at infinity → all poi..
2023.10.10 -
[Computer Graphics] Shadow Mapping
- Shadow helps depth perception. - Shadow depends on the light and geometry. - This area is in shadow due to occlusion from the object. - 이 영역 밖은 seen by camera & seen by light - 이 영역 안은 seen by camera & not seen by light - Occlusion: point seen by camera but not seen by light Two Step algorithm to create shadows: Step 1) Determine d1 by making shadow map. Step 2) Compute d2 during shading and c..
2023.10.10 -
[Computer Graphics] Texture Mapping
Texture Mapping - Applying an image to a 3D shape - Map from Texture Coordinate to 3D Point - f: (s, t) → (x, y, z, w) (ex. (0, 0) → (-1, -1, 1, 1) - s ∈ [0, 1], t ∈ [0, 1] - Texture Element = Texel - Some vertex has different texture coordinates → handled by duplicating the vertex Texture Mapping Cube in WebGL - Just as we have vertex buffers to store the vertex data, - color buffers to store t..
2023.10.10 -
[Computer Graphics] Lighting
- Light source emits light rays in many directions in 3D. - Lighting에 필요한 것: light sources, material properties of the objects, reflectance coefficients Types of Light Sources 1. Ambient Light - Uniform light present everywhere. - 3 values: Iar(ambient red), Iag(ambient green), lab(ambient blue) ex) Iar = 150, Iag = 150, Iab = 20 2. Point Light - Brightness falls off as square of distance. - p0을..
2023.10.10 -
[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