Computers render 3D by first representing objects using simple geometric shapes and then processing these shapes to create the final image. A fundamental way this is done is by building 3D models from a "mesh" of basic polygons, primarily triangles.
Building the Foundation: Polygon Meshes
At the heart of 3D rendering is the concept of representing complex objects using simpler building blocks. The most common approach, described in the provided reference, involves creating objects from a mesh of polygons or virtual triangles.
- Meshes: Think of a mesh as the skeleton or wireframe of a 3D object. It's a collection of connected geometric primitives.
- Polygons/Triangles: These are the basic shapes within the mesh. Triangles are particularly useful because they are inherently flat (planar) and mathematically simple, making them easy for computers to process consistently.
- Vertices: These are the corners or points where the edges of the polygons or triangles meet. As the reference states, "the corners (vertices) of each triangle intersect with the vertices of triangles of different shapes and sizes" within the mesh. These vertices define the shape and structure of the 3D model.
So, whether rendering a character, a car, or a building, the computer sees it internally as a vast collection of interconnected triangles or polygons defined by their vertices.
Processing the Mesh: Rendering Techniques
Once the 3D world and objects are represented as meshes of polygons and their vertices, the computer uses various techniques to turn this data into a 2D image displayed on your screen. One primary technique is Rasterization.
- Rasterization: This is a classic and highly efficient method used in real-time rendering (like video games). With Rasterization, the computer takes the 3D polygons (triangles) defined by their vertices and projects them onto a 2D plane (your screen). It then determines which pixels on the screen are covered by each projected triangle.
- Filling the Pixels: Once the pixels covered by a triangle are identified, the computer fills them with color, taking into account factors like texture, lighting, and the object's material properties. This process effectively converts the geometric shapes into a grid of colored dots (pixels) that form the final image.
While other rendering techniques exist (like Ray Tracing), Rasterization working with polygon meshes remains a cornerstone of how computers generate 3D visuals, translating complex models built from simple triangles into the images you see.