Introduction

The term computer graphics describes any use of computers to create and manipulate images. This note presents some basic terminology and information sources related to computer graphics.

Graphics Areas

Most graphics practitioners involve into following major areas of computer graphics.

  • Modeling
  • Rendering
  • Animation
  • User Interaction
  • Virtual Reality
  • Visualization
  • Image Processing
  • 3D scanning
  • Computational Photography

Major Applications

The major consumers of computer graphics technology include the following industries:

  • Video Games
  • Cartoons
  • Visual Effects
  • Animated Films
  • CAD / CAM
  • Simulation
  • Medical Imaging
  • Information Visualization

Graphics Pipeline

The basic operations in the pipeline map the 3D vertex locations to 2D screen positions and shade the triangles so that they both look realistic and appear in proper back-to-front order.

Numerical Issues

Almost all modern computers conform to the IEEE floating-point standard (IEEE Standards Association, 1985).

There are three "special" values for real numbers in IEEE floating-point:

  • Infinity (∞):This is a valid number that is larger than all other valid numbers.

  • Minus Infinity (−∞): This is a valid number that is smaller than all other valid numbers.

  • Not a number (NaN): This is an invalid number that arises from an operation with undefined consequences, such as zero divided by zero.

For any positive real number a, the following rules involving division by infinite values hold:

图片说明
图片说明
图片说明
图片说明

Other operations involving infinite values behave the way one would expect.

图片说明
图片说明
图片说明
图片说明
图片说明
图片说明
图片说明

The rules in a Boolean expression involving infinite values are as expected:

  • All finite valid numbers are less than +∞.

  • Allfinitevalidnumbersaregreaterthan−∞.

  • −∞ is less than +∞.

The rules involving expressions that have NaN values are simple:

  • Any arithmetic expression that includes NaN results in NaN.

  • Any Boolean expression involving NaN is false.

Perhaps the most useful aspect of IEEE floating-point is how divide-by-zero is handled; for any positive real number a, the following rules involving division by zero values hold:

图片说明

Efficiency

There are no magic rules for making code more efficient. Efficiency is achieved through careful tradeoffs, and these tradeoffs are different for different architectures.

A reasonable approach to making code fast is to proceed in the following order, taking only those steps which are needed:

  • Write the code in the most straightforward way possible. Compute intermediate results as needed on the fly rather than storing them.

  • Compile in optimized mode.

  • Use whatever profiling tools exist to find critical bottlenecks.

  • Examine data structures to look for ways to improve locality. If possible, make data unit sizes match the cache/page size on the target architecture.

  • If profiling reveals bottlenecks in numeric computations, examine the as- sembly code generated by the compiler for missed efficiencies. Rewrite source code to solve any problems you find.

In all situations, profiling is needed to be sure of the merit of any optimization for a specific machine and compiler.