Wednesday, 3 July 2013

Geometry Theory



What makes up a 3D mesh

A 3D mesh is made with 5 different types of elements. They are vertices, edges, faces, polygons and elements

Vertices are the points of the 3D mesh. For example a cube,there are 8 points in the cube that are essential parts, the 8 corners. Each point are called the Vertex.
Edges are lines segment between two vertices points. For example in the cube there are 12 line segments and each of the line segments are edges.
Faces is connected by set of edges. Picture on the right shows a cube. In a cube each whole faces are made of 2 triangles. Picture on the right highlights them. Each triangle face are made out of 3 edges/line segments.
Polygon is plane figure that are bounded by finite chain of edges/line segments.
Surface is a 3D collection of points whose cross section is a curved surface, or the boundary of any 3D solid.

Tuesday, 2 July 2013

Graphics Pipeline

The 3D pipeline is the process in which 3D objects  are turned into a 2D image on your monitor. There are many steps that the GPU has to go through in order to do that.

1) The computer determine the position of the objects in the 3D scene, this is done by processing every vertices and point to make up the model.


2) The computer will now calculate the position of the 3D objects from a cameras point of view and calculate where the 3D positions would be in a 2D view.

3) Any objects or part of an object that is outside the camera view are clipped from the 2D view this way it doesn't need to process any information about the objects. 

4) The lighting of the scene is processed information such as position and intensity, with this shading information is also applied.
There are 3 main types of shading, phong shading, gourand shading and flat shading.


5) The process of rendering the 2D image of the 3D scene as an array of screen pixels is called rasterization. This involves ensure the colour of each pixel that make up the 2D image.

6) Before that the image can resterization the computer needs to determine which 3D surface is hidden behind another from the camera view point. This is called Z-Sorting or Z-buffering.