lectures.alex.balgavy.eu

Lecture notes from university.
git clone git://git.alex.balgavy.eu/lectures.alex.balgavy.eu.git
Log | Files | Refs | Submodules

applications-to-computer-graphics.html (2874B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <script type="text/javascript" async src="https://cdn.jsdelivr.net/gh/mathjax/MathJax@2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
      5 <link rel="Stylesheet" type="text/css" href="style.css">
      6 <title>applications-to-computer-graphics</title>
      7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      8 </head>
      9 <body>
     10 
     11 <div id="Applications to computer graphics"><h2 id="Applications to computer graphics">Applications to computer graphics</h2></div>
     12 <p>
     13 graphics are stored in a matrix, such as this:
     14 </p>
     15 
     16 <p>
     17 <img src="img/graphics-coordinate-matrix.png" alt="Graphics coordinate matrix" /> <img src="img/vector-letter-n.png" alt="Vector letter N" />
     18 </p>
     19 
     20 <div id="Applications to computer graphics-Homogeneous coordinates"><h3 id="Homogeneous coordinates">Homogeneous coordinates</h3></div>
     21 <div id="Applications to computer graphics-Homogeneous coordinates-2D"><h4 id="2D">2D</h4></div>
     22 <p>
     23 each point (x, y) in 2D can be identified with point (x, y, 1) in 3D. so we say that (x, y) has homogeneous coordinates (x, y, 1).
     24 </p>
     25 
     26 <p>
     27 e.g. translation is not a linear transformation. but \((x, y) \mapsto (x+h, y+k)\) can be written in homogeneous coordinates as \((x, y, 1) \mapsto (x+h, y+k, 1)\), and can be computed using matrix multiplication:
     28 </p>
     29 
     30 <p>
     31 \(\begin{bmatrix} 1 &amp; 0 &amp; h\\ 0 &amp; 1 &amp; k\\ 0 &amp; 0 &amp; 1\end{bmatrix} \begin{bmatrix} x \\ y \\ 1 \end{bmatrix} = \begin{bmatrix} x+h \\ y+k \\ 1 \end{bmatrix}\)
     32 </p>
     33 
     34 <div id="Applications to computer graphics-Homogeneous coordinates-3D"><h4 id="3D">3D</h4></div>
     35 <p>
     36 (X, Y, Z, H) are homogeneous coordinates for (x, y, z) if H ≠ 0 and
     37 </p>
     38 
     39 <p>
     40 \(x = \frac{X}{H}, \quad y = \frac{Y}{H}, \quad \text{and} \; z = \frac{Z}{H}\)
     41 </p>
     42 
     43 <div id="Applications to computer graphics-Matrices for typical transformations"><h3 id="Matrices for typical transformations">Matrices for typical transformations</h3></div>
     44 <p>
     45 <img src="img/typical-transformations.png" alt="Typical transformations" />
     46 </p>
     47 
     48 <div id="Applications to computer graphics-Composite transformations"><h3 id="Composite transformations">Composite transformations</h3></div>
     49 <p>
     50 when you need two or more basic transformations, such a composite transformation is a matrix multiplication.
     51 </p>
     52 
     53 <p>
     54 matrices for new transformations are "prepended" in multiplication. so if you're rotating, then translating, the calculation is <code>[matrix for translation][matrix for rotation]</code>.
     55 </p>
     56 
     57 <div id="Applications to computer graphics-Perspective projections"><h3 id="Perspective projections">Perspective projections</h3></div>
     58 <p>
     59 maps each point (x, y, z) onto an image point (x*, y*, 0) so that two points and eye position (center of projection) are on a line.
     60 </p>
     61 
     62 <p>
     63 <img src="img/perspective-projection-diagram.png" alt="Perspective projection diagram" />
     64 </p>
     65 
     66 </body>
     67 </html>