3D GraphicsBeyond the world of 2-dimensional, flat graphics, exists the exciting world of 3-dimensional graphics. More often than not, these 3D graphics are displayed on a 2-dimensional computer screen, by projection from the 3D volume to the 2D plane.
|
||||||||||||||||||
|
|||||||||
![]() |
An R2 unit with the Author. This model contains many thousands of polygons. |
In addition to the geometry of the scene, 3D graphics creators also generally have to specify the materials for the objects and the lighting in the scene. The rendering tool automatically creates such things as the darker sides of objects that are away from the light source, but the renderer must have a guide for how to do this. This guide is provided by the materials and lighting specification.
Different Material Properties |
|
![]() |
![]() |
A Sphere Rendered in a Shiny, Refractive Material |
The Same Sphere Rendered in a Red to Yellow Gradient |
A 3D scene can be rendered in real-time. This means that the data stored in the file format is the set of 3D scene primitives. Generally speaking, the renderer takes the primitives, decomposes them into polygons, and then renders each polygon into a bitmap. In addition to a value for the color of each pixel, the bitmap also stores a value for the current depth into the image of the pixel that is displayed. This set of depth values is called the z-buffer, and allows the renderer to correctly display a scene in which polygons are in front of and behind others, and even polygons that intersect. While evaluating a polygon, and placing it into the bitmap, a test is done to determine if its z value (depth) at the current pixel is greater than the depth value currently in the z-buffer. If the value is greater, then the pixel is not displayed, otherwise it is.
Various software products exist to render 3D images in real time. Games such as Quake perform this rendering to produce realistic looking environments. A good solution for individuals who would like to create real time rendered 3D scenes is to use VRML an ISO standard for Virtual Reality modeling (the Virtual Reality Modeling Language). Various VRML viewers are available, many of which are plug-in extensions for web browsers. Popular viewers include CosmoPlayer and WorldView. Take a look at the VRML Consortium website for more details: http://www.vrml.org/
Often, images of far better quality can be created using a rendering tool called a raytracer, than can be rendered in real time. A raytracer takes the scene description, and traces the path of light rays within the image. The output from this process is a 2-dimensional bitmap, which depicts the content of the scene.
The exact mechanism of raytracing is usually as follows: The scene description defines an eye point (or camera position), and at least one light source. The eye point is conceptually the position of the viewers eye outside the computer screen, and a further construct called the viewing plane is defined by properties of the eye point. The viewing plane is the bitmap that will eventually be displayed, and therefore contains a number of pixels. The viewing plane lies, in the direction into the scene, between the eye point and the scene elements to be displayed. Rays are traced out from the eye point, through each pixel in the viewing plane, and out into the scene. Each ray can reflect and refract, and can be modified by absorption and filtering. Eventually, these rays end up outside the scene, and either go to infinity, or pass near a light source. Those rays that go to infinity do not contribute to the color of pixels in the viewing plane, and rays which pass near a light source can be traced back to the eye point, and the final color of the pixel can be determined.
Raytracing can produce extremely high quality images, but it is not practical to raytrace in real time. Raytraced images have all the reflection and refraction that is present in real life objects, whereas real time rendered images generally do not. Raytracing should be used where high quality still graphics are required, or where time is available to render a high quality movie. Raytracing is the technique generally used to create realistic looking objects in the motion picture industry.
The very best raytracer available to most people is the Persistence of Vision Raytracer. The sample primitives above were created in a matter of a few minutes with this absolutely first class, freeware tool. Take a look at http://www.povray.org/ and be dazzled!