How is math used in computer graphics?

12k Views Asked by At

I'm doing a research paper on the mathematics of computer graphics and animation (3D) and I do not know where to start. What mathematical equations and concepts are used for computer graphics and animation (3D)?

3

There are 3 best solutions below

0
On

Like many questions of the form: How much math do you need to know/do X? It depends greatly on how far you want to take things. For simple 3D computer graphics or 2D computer graphics, say just a 2D Tetris like game for your phone or what have you, elementary geometry can be all you need. But for 3D computer graphics, games like Call Of Duty or CAD computer programs, where the developers are using advanced libraries like OpenGl and DirectX, linear algebra and calculus comes into play. Cutting edge/active areas of research in computer graphics use the most advanced algorithms and math available, signal processing, optimization, differential equations, etc. You name it, basically every field of math in some way.

For a look at what kind of math is introduced and used in more simple/not terribly advanced applications of computer graphics, look at these two resources:

Taste of math used in basic computer graphics:

  1. Eric Haines's (a prominent figure in computer graphics) has a free course at Udacity that is an introduction to interactive 3D Computer Graphics: Interactive 3D Graphics. Really high quality material he produced for this course. Notice how even though its 3D, the math is too crazy since it goes back to how far you want to take things.
  2. Another free online resource, Jason L. McKesson's Learning Modern 3D Graphics Programming
  3. And lastly but certainly not least, you have Processing, a programming language partly created to introduce the concepts of 2D/3D computer graphics to an audience with no programming/math experience: Processing

Taste of math used in advanced computer graphics:

  1. This book, Mathematics for 3D Game Programming and Computer Graphics
  2. The SIGGRAPH (short for Special Interest Group on GRAPHics and Interactive Techniques) website. This association is home to many engineers and scientists who are active researchers in the field of computer graphics. All sorts of helpful links on this site. SIGGRAPH
  3. And why not have a look at some of the newest research papers about computer graphics, try to read a paper and use this site and other resources to try and understand it, this will give you an impression of the very advanced mathematical techniques utilized by active researchers. This is the "farthest" you can take things: arXiv Computer Graphic's Papers
  4. I mentioned video games mostly as examples of computer graphics applications. just since they are usually the most i guess relatable or tangible applications of computer graphics. But scientists use computer graphics in many other ways, to visualize things like nuclear weapons, stellar evolution, climate and weather etc. Take a look at some of the areas of research using visualization at: Sandia National Laboratories. The physics simulations there use every kind of math possible in some way. Whether that is helpful to you writing your paper or not, depends :).
0
On

Two main results that tend to form the core of 3D graphics:

(1) 3D coordinates are represented by matrices:

$$\begin{bmatrix} x \\ y \\ z \end{bmatrix}$$

Transforms (like rotations) are represented by matrix multiplication:

$$\begin{bmatrix} \text{new-x} \\ \text{new-x} \\ \text{new-x} \end{bmatrix} = \begin{bmatrix} m_{1,1} & m_{1,2} & m_{1,3} \\ m_{2,1} & m_{2,2} & m_{2,3} \\ m_{3,1} & m_{3,2} & m_{3,3} \end{bmatrix}\begin{bmatrix} x \\ y \\ z \end{bmatrix}$$

Transforms like moving a point a given distance are represented by adding:

$$\begin{bmatrix} \text{new-x} \\ \text{new-x} \\ \text{new-x} \end{bmatrix} = \begin{bmatrix} \Delta x \\ \Delta y \\ \Delta z \end{bmatrix} + \begin{bmatrix} x \\ y \\ z \end{bmatrix}$$

A move and a transform can be combined into 1 operation, which is how your video card does it:

$$\begin{bmatrix} \text{new-x} \\ \text{new-x} \\ \text{new-x} \\ 1\end{bmatrix} = \begin{bmatrix} m_{1,1} & m_{1,2} & m_{1,3} & \Delta x \\ m_{2,1} & m_{2,2} & m_{2,3} & \Delta y \\ m_{3,1} & m_{3,2} & m_{3,3} & \Delta z \\ 0 & 0 & 0 & 1 \end{bmatrix}\begin{bmatrix} x \\ y \\ z \\ 1 \end{bmatrix}$$

So to begin with, your computer does most of it's coordinate representations and transforms with $4$ by $4$ matrices.

(2) 3D has to become 2D to appear on your screen

Converting the 3D coordinate of a shape into the 2D point on your screen is called projection, usually perspective projection but sometimes orthographic projection or something else.

Here is a start of learning about 3D projections.

1
On

Computer graphics is a broad field (and consequently the mathematics used), so I'm going to focus on the mathematics and techniques used in animation, specifically, special effects in movies to answer your question. Worth noting that while the focus of this answer is narrow, the domains mentioned are also used in other areas of computer graphics.

The mathematics used in animation can be fairly simple. For example, after the release of the film Tron Legacy, Joshua T. Nimoy of Digital Domain wrote about the techniques he used on the film covering everything from basic linear algebra, geometry, physics-based calculus, topology and numerical methods.

While simple mathematics can be used to animate most real world objects, more advanced mathematics is required to animate things such as fabric, fire, fluids, fur and smoke in film. In particular, differential geometry and (partial) differential equations are used. Aleka McAdams, Stanley Osher and Joseph Teran wrote an excellent survey (pdf) on how these domains are used. More technical notes (pdf) from 2002 SIGGRAPH workshop on Level Set and PDE Methods for Computer Graphics is also worth a look.

The mathematics used are just part of the picture, additional tools used from computer science and software engineering (e.g., data structures, computational geometry, and optimization) are used to devise optimal algorithms to efficiently produce animations in the least amount of time with the greatest clarity.

Hopefully this gives you a better idea of the breadth of mathematics used in computer graphics for animation. If you want to learn more, you can pick a handful of papers from any one of the conference proceedings or journals below to get a better idea.