Geometry
Examples of geometry
Implicit geometry (Inplict)
Definition: Expressed by a function, such as f(x,y,z)=0.
Explicit geometry (Explict)
Definition: All points are given directly or through parameter mapping.
All (u, v) are mapped to the corresponding (x, y, z) to form a surface.
Various representations of geometry
Implicit geometric representation method
-
algebraic surface
-
CSG
performs Boolean operations on various geometries, such as union, intersection, and difference. -
Signed Distance Function (SDF)
describes the shortest distance from a point to the surface of an object. The outer surface is positive and the inner surface is negative. -
Level Set
takes the point where the function value is 0 as a curve
-
Fractals
Explicit geometric representation method
-
Point cloud
gives the attribute information of the points to form a geometric figure -
Polygon Meshes (Widely Used)
A polygon mesh consists of a set of adjacent faces (usually triangles or quadrilaterals) that store the vertices and polygons that define locations on an object's surface. Each vertex usually contains three-dimensional coordinate information and other attributes, such as normals, texture coordinates, etc.
-
obj format
is a text file that specifies vertices, normals, texture coordinates and their connectivity.
As shown above: v is the vertex, vn is the normal vector, and vt is the texture coordinate. And f is the connection relationship between them. Take line 36 as an example: a/b/c, representing vertices/textures/normals respectively. Then the whole thing is that the 5th, 1st, and 4th vertices form a triangle, using the 1st, 2nd, and 3rd textures respectively, and the normals are 1, 1, and 1 respectively (actually they are all normals of the triangle surface.
curve
Bezier curve
Describes a smooth shape, a curve defined by control points and weight factors.
by Casteljau Algorithm
de Casteljau's algorithm uses multiple points to draw a Bezier curve.
Piecewise Bezier Curve
When there are too many control points, segmented representation
Bezier surface
Approach
Oversampling increases resolution, downsampling decreases resolution, and regularization modifies the sample distribution to improve quality. First, create more polygons (vertices), and second, adjust their positions.
Mesh subdivision
- Loop Subdivision
- Triangular mesh-based surface subdivision method. It works by iteratively subdividing triangles, generating new vertices and triangles, making the surface gradually smoother.
- Catmull-Clark
surface subdivision method based on quadrilateral mesh. It subdivides the quad iteratively by
Mesh simplification
Goal: Reduce the number of mesh elements while maintaining the overall shape
- Collapsing An Edge edge collapse algorithm
After simplification, attention should be paid to reducing the error caused by collapse:
1. Calculate the error value of each edge collapse, perform heap sorting and greedy algorithm, and select the edge with the smallest error to start collapse.
2. Update with the minimum cost and update the affected edges with the minimum quadratic error.
Mesh regularization
Shadow Mapping
The difference from rasterization: rasterization only considers one point of coloring, and does not take into account objects covering it.
Two different projections: image from the light source and record the depth once, image from the camera to the object, and then reverse the direction from the object to the light source to record the depth. Determine whether the two depth maps are equal. If they are equal, the object is unobstructed.
-
Hard Shadow :
A clear, sharp shadow effect caused by light occlusion. In hard shadows, light cannot pass through the occluding object, so the pixels in the shadow area are completely blocked and no light reaches it, resulting in a sharp contrast between light and dark in the shadow area. -
Soft Shadow is
a blurry, soft shadow effect produced by light occlusion. In soft shadows, light can partially pass through the occluding object, so pixels in the shadow area may be partially illuminated, causing the shadow area to show a gradient light and dark effect. -
Umbra is
the area where light cannot reach when a celestial body blocks the light source. In the umbra, the observer cannot see the light source and is therefore completely in shadow. -
Penumbra (Penumbra)
is an area where light can only partially reach when a celestial body blocks the light source. In the penumbra, part of the light source is visible to the observer, but the light is partially blocked, causing the area to appear as a gradient of light and dark.