Computer graphics is a term that refers both to the use of computers to create or change images and to the images themselves. Such images can be individual pictures, such as photographs or diagrams. Or they may form part of a motion picture, such as an animated cartoon, music video, or feature-length movie. Computer graphics form the visuals of electronic games. Typically, computer graphics involves creating three-dimensional models with a computer program. The models can be “posed” at different angles, giving the resulting imagery a sense of depth. Generating finished three-dimensional images from computer models is called rendering.
Uses of computer graphics
Computer graphics is best known for its applications in entertainment. However, it also makes important contributions in science, engineering, and medicine.
In entertainment and the arts,
computer graphics provides animation and special effects for motion pictures and television shows. This use of computer graphics is called computer-generated imagery (CGI). Animators use CGI to give the illusion of motion and personalities to dinosaurs, toys, insects, and other cartoon characters. Filmmakers use CGI to create artificial environments for motion pictures. For example, CGI may create an ocean setting for scenes shot in a studio rather than at sea. In addition, realistic-looking CGI models can be rendered side-by-side with live human actors. Such models include cars, spaceships, dangerous animals, and fantastic creatures.
Computer graphics also include interactive images for electronic games. The computer graphics used for these games must react to a player’s control. For example, if a game takes place in a fantasy world, the computer must render grass, trees, and monsters as a player explores the landscape. It must also render images at least 24 times per second to provide the illusion of fairly smooth movement. Rendering richly detailed, fully interactive game worlds requires much computer power. Thus, game designers often must make compromises—for example, by rendering only small parts of a game area at a time.
In science,
computer graphics helps researchers produce images of real objects that cannot be seen clearly because of their size or location. The use of computer graphics to convey such information visually is called scientific visualization. For example, scientists use computer graphics to draw pictures of DNA (deoxyribonucleic acid) molecules. DNA plays a key role in heredity and cell development. The pictures enable scientists to better understand the functions of DNA.
Computer graphics can also be used to graph or chart abstract mathematical values or measured physical quantities. These graphs can be simple, such as one that plots the vertical position of points as a function of their horizontal position. Or the graphs can be sophisticated, three-dimensional renderings of data. Differences in position, color, brightness, or other features may indicate different aspects of the data. Scientists can use such graphs to gain insight into physical processes. For example, a chemist might create a graph that shows the energy levels at which molecules react with one another to produce a certain substance. The “valleys” in this graph would indicate how the substance could be produced using less energy.
In engineering,
computer graphics can enable a machine designer to create a three-dimensional computer representation of the shape of an object, called a geometric model. Using a process called computer aided design (CAD), the designer can see how a new part would appear or function.
In medicine,
computer graphics enables physicians to “see” inside the body. Computed tomography (CT) involves many X-ray images of a body, taken from a number of different directions. A computer combines the set of X-ray “slices” of the body to create a three-dimensional image called a volumetric model. A volumetric model incorporates information about the size, shape, texture, and density of structures inside the body. Doctors might then use this volumetric model to pinpoint the location of a tumor. Doctors can even use such models to practice surgical operations.
How a computer creates images
Computer graphics models are generally made of polygons—simple, two-dimensional shapes, such as triangles or squares. Polygons can be arranged into virtually any three-dimensional form. Artists can also give polygons properties, such as colors and textures. In rendering, the computer takes a “picture” of these polygonal models. Like a digital photograph, the rendered image is visible as a grid of pixels or picture elements on a screen. Some screens have millions of pixels.
In one rendering technique, called ray tracing, the computer sends a ray (pointed line) from each pixel into the scene. The pixels display whatever the rays intersect. Rays from virtual light sources can create accurate shadows and reflections on the polygons. Ray tracing produces highly realistic images, but it is slow and requires much computing power. It is sometimes used in motion-pictures and in pre-rendered (noninteractive) scenes in electronic games.
Rasterization is a faster rendering technique. It first determines which polygons in the scene should be visible on screen. The pixels then display an image based on the properties of only those polygons. Rasterization does not track how light and shadow change the appearance of polygons. But such effects can be simulated through other means.