Clipping and Hidden Surface Determination Exercises#

Exercise 21

Use the Cyrus-Beck algorithm to clip the lines \(\mathbf{a} \to \mathbf{b}\), \(\mathbf{c} \to \mathbf{d}\) and \(\mathbf{e} \to \mathbf{f}\) to the visible region shown in the diagram below.

../_images/exercise_21.png

Exercise 22

Use the Sutherland-Hodgman algorithm to clip the polygon with vertices \(\mathbf{v}_1\), \(\mathbf{v}_2\) and \(\mathbf{v}_3\) to the rectangle shown below

../_images/exercise_22.svg

Exercise 23

A tetrahedron object is defined by the vertex and face matrices

\[\begin{split} \begin{align*} V &= \begin{pmatrix} 1 & 2 & 0 & 1 \\ 1 & 2 & 3 & 0 \\ -7 & -6 & -5 & -4 \\ 1 & 1 & 1 & 1 \end{pmatrix}, & F &= \begin{pmatrix} 3 & 2 & 1 \\ 2 & 3 & 4 \\ 1 & 2 & 4 \\ 3 & 1 & 4 \end{pmatrix}. \end{align*} \end{split}\]

The object is viewed from the origin. Determine which faces of the tetrahedron are front facing.

Exercise 24

A plan view of a map of a computer game is shown in the diagram below. Assuming all vectors are facing towards the interior, construct a BSP tree of the map.

../_images/exercise_24.svg

Exercise 25

A solution to Exercise 24 is shown below.

../_images/exercise_25.svg
../_images/exercise_24_sol2.svg

Determine the rendering order of the polygons when the world is viewed from the positions \(\mathbf{p}\), \(\mathbf{q}\) and \(\mathbf{r}\).