In computer graphics, a polygon is a geometric primitive used in modelling and rendering. They are defined in a database, containing arrays of vertices (the coordinates of the geometrical vertices, as well as other attributes of the polygon, such as color, shading and texture), connectivity information, and materials. The 3D environs of Hovertank 3D and Catacomb 3D are created by drawing the walls as polygons, which are then put together with sprites cohesively by means of rasterization.
Naming conventions differ from those of mathematicians:
- A simple polygon is convex, planar, more easily handled by algorithms and hardware.
- a concave polygon is a simple polygon having at least one interior angle greater than 180°.
- A complex polygon may have arbitrary topology including holes, requiring more advanced algorithms (often systems will tesselate these into simple polygons).
Any surface is modelled as a tessellation called polygon mesh. If a square mesh has n + 1 points (vertices) per side, there are n squared squares in the mesh, or 2n squared triangles since there are two triangles in a square. There are (n + 1)2 / 2(n2) vertices per triangle. Where n is large, this approaches one half. Or, each vertex inside the square mesh connects four edges (lines).
The imaging system calls up the structure of polygons needed for the scene to be created from the database. This is transferred to active memory and finally, to the display system (screen, TV monitors etc.) so that the scene can be viewed. During this process, the imaging system renders polygons in correct perspective ready for transmission of the processed data to the display system. Although polygons are two-dimensional, through the system computer they are placed in a visual scene in the correct three-dimensional orientation.