\documentclass[conference]{styles/acmsiggraph}
\usepackage{comment} % enables the use of multi-line comments (\ifx \fi)
\usepackage{lipsum} %This package just generates Lorem Ipsum filler text.
\usepackage{fullpage} % changes the margin
\usepackage{enumitem} % for customizing enumerate tags
\usepackage{amsmath,amsthm,amssymb}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{etoolbox} % for booleans and much more
\usepackage{verbatim} % for the comment environment
\usepackage[dvipsnames]{xcolor}
\usepackage{fancyvrb}
\usepackage{hyperref}
\usepackage{menukeys}
\usepackage{titlesec}
\setlength{\parskip}{.8mm}
\setcounter{MaxMatrixCols}{20}
%\title{\huge Homework 4: Build Your Own HMD, Implement Stereo Rendering and Lens Distortion Correction \\ \LARGE \textit{EE267 Virtual Reality 2019}}
%\author{\LARGE \textbf{Due:} 05/02/2019, 11:59pm}
%\pdfauthor{EE267 Instructors}
\title{\huge Homework 4: Solutions \\ \LARGE {CSE 490V: Virtual Reality Systems}}
\author{\Large Student Name \\ student@uw.edu}
\pdfauthor{Student Name}
\hypersetup{
colorlinks=true,
urlcolor=[rgb]{0.97,0,0.30},
anchorcolor={0.97,0,0.30},
linkcolor=[rgb]{0.97,0,0.30},
filecolor=[rgb]{0.97,0,0.30},
}
% redefine \VerbatimInput
\RecustomVerbatimCommand{\VerbatimInput}{VerbatimInput}%
{fontsize=\footnotesize,
%
frame=lines, % top and bottom rule only
framesep=2em, % separation between frame and text
rulecolor=\color{Gray},
%
label=\fbox{\color{Black}\textbf{OUTPUT}},
labelposition=topline,
%
commandchars=\|\(\), % escape character and argument delimiters for
% commands within the verbatim
commentchar=* % comment character
}
\titlespacing*{\section}{0pt}{5.5ex plus 1ex minus .2ex}{2ex}
\titlespacing*{\subsection}{0pt}{3ex}{2ex}
\setcounter{secnumdepth}{4}
\renewcommand\theparagraph{\thesubsubsection.\arabic{paragraph}}
\newcommand\subsubsubsection{\paragraph}
% convenient norm symbol
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\renewcommand{\vec}[1]{\mathbf{#1}}
% a macro for hiding answers
\newbool{hideanswers}
\setbool{hideanswers}{false}
\newenvironment{answer}{}{}
\ifbool{hideanswers}{\AtBeginEnvironment{answer}{\comment} %
\AtEndEnvironment{answer}{\endcomment}}{}
\newcommand{\points}[1]{\hfill \normalfont{(\textit{#1pts})}}
\newcommand{\pointsin}[1]{\normalfont{(\textit{#1pts})}}
\graphicspath{{}{"/Volumes/GoogleDrive/My Drive/EE 267, Spring 2019/hw_figures/"}{imgs/}}
\begin{document}
\maketitle
\section{Theoretical Part}
%%%%%%%%%%%%%%%%%%
% Question #1 %
%%%%%%%%%%%%%%%%%%
\subsection{Consistent Occlusions in Optical See-Through AR \points{10}}
Optical see-through (OST) augmented reality (AR) displays overlay digital content onto the physical world using an optical combiner. Thus, the physical and digital objects follow an additive superposition principle with each component being mostly independent of the other. This is unlike the physical world where the lighting and shading of different objects influence each other, for example by casting shadows or by occluding each other. Note that occlusions are one of the most important depth cues for the human visual system, but, unfortunately, it is not straightforward to implement consistent occlusions between physical and digital objects in OST AR systems.
In general, we can distinguish between two cases of occlusions in AR: (a) a digitally displayed object could appear (at least partly) behind a physical object, i.e., the physical object occludes the digital object and (b) a physical object could appear (at least partly) behind a digital object, i.e., the digital object occludes the physical object.
\begin{enumerate}[label=(\roman*)]
\item Briefly describe an engineering solution that solves problem (a). What information do you need of the physical object and the digital object so that your solution works well? Do you need any additional sensors, such as special cameras? Describe exactly what sensors or information you need and how your solution works. \pointsin{5}
\item Briefly describe an engineering solution that solves problem (b). What information do you need of the physical object and the digital object so that your solution works well? If you cannot come up with a good technological solution for this case, describe in detail what would have to happen for this to work. \pointsin{5}
\end{enumerate}
\begin{answer}
\rule{\textwidth}{0.4pt}
\textbf{Answer:}
\begin{enumerate}[label=(\roman*)]
%%%%%%%%
% Q1 %
%%%%%%%%
\item Write your answer to this question here.
\item Write your answer to this question here.
\end{enumerate}
\rule{\textwidth}{0.4pt}
\end{answer}
%%%%%%%%
% Q2 %
%%%%%%%%
\newpage
\subsection{Geometrical Optics \points{25}}
As illustrated in Figure~\ref{fig:lightguidein}, consider a projector that emits light into one end of a light guide. The light travels through the light guide and comes out at the other end (Fig.~\ref{fig:lightguideout}, left). Assume that the refractive index of the glass $n_2$ is $\sqrt{2}$ and that the refractive index of air $n_1$ is approximated as 1. In this question, the critical angle is defined with respect to the surface normal (dashed lines in the figures). For simplicity, the thickness of the projector lens and possible refractions on the air--lens interface can be neglected.
\begin{figure}[h!]
\centering
\includegraphics[width=0.6\textwidth]{./imgs/waveguide}
\caption{Projected light coupled into a light guide.}
\label{fig:lightguidein}
\end{figure}
\begin{figure}[h!]
\centering
\includegraphics[width=\linewidth]{./imgs/waveguide-45}
\caption{Projected light coupled out of the light guide and into the viewer's eye.}
\label{fig:lightguideout}
\end{figure}
\begin{enumerate}[label=(\roman*)]
\item What is the critical angle for light entering air from the light guide? The critical angle is the largest angle of incidence for which refraction can still occur. For any angle of incidence greater than the critical angle, light will undergo total internal reflection (see Fig.~\ref{fig:lightguidein}). \pointsin{5}
\item If light bounces in the light guide at $\theta_{TIR} = 60^\circ$, what is the angle at which light should be projected into the light guide (i.e., calculate $\theta_1$)? (See Fig.~\ref{fig:lightguidein}.) \pointsin{5}
\item Given projection angle $\theta_1$, from the previous question, and a projector lens with focal length $f$ = 60~mm, what is the width of the microdisplay such that all of the emitted light is steered into the light guide? (Assume that the light guide is arbitrarily wide and that the microdisplay is 60~mm away from the lens.) \pointsin{5}
\item A mirror is placed at an angle of $45\degree$ at the other end of the light guide. What is the field of view $\theta_e$ (see Fig.~\ref{fig:lightguideout})? \pointsin{5}
\item We hope to increase $\theta_e$ to $120\degree$, so that users have a more immersive experience. For this purpose, we decide to use the same light guide,. but made of a different material. What would be the smallest required refractive index $n_2^\prime$ for the light guide? Can you easily find an optically transparent material with that refractive index? (Use Wikipedia to browse the refractive indices for different transparent materials.) \pointsin{5}
\end{enumerate}
\begin{answer}
\rule{\textwidth}{0.4pt}
\textbf{Answer:}
\begin{enumerate}[label=(\roman*)]
%%%%%%%%
% Q2 %
%%%%%%%%
\item Write your answer to this question here.
\item Write your answer to this question here.
\item Write your answer to this question here.
\item Write your answer to this question here.
\item Write your answer to this question here.
\end{enumerate}
\rule{\textwidth}{0.4pt}
\end{answer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Programming Written Deliverables %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Programming Part PDF Deliverables}
\subsubsection*{2.1.3 Stereo Rendering Perceptual Experiments \points{10}}
Once your stereo rendering works, perform a few simple perceptual experiments. In the PDF with your solutions for the theoretical part, report your experience in a short paragraph for each of the following questions:
\begin{enumerate}[label=(\roman*)]
\item Vary the interpupillary distance (IPD) in the code while looking at the same, static 3D scene. Describe the perceptual effect of the varying IPD. \pointsin{5}
\item Experiment with the vergence--accommodation conflict (VAC). How far can you move objects out of and into the screen, i.e., away from the virtual image, while still being able to fuse the stereo images? Your visual system is quite resilient during continuous viewing, so errors might not be immediately apparent. Try closing your eyes for a bit, and then viewing the scene fresh. You should start seeing the effects then. Report the minimum and maximum depths for which you can comfortably fuse the stereo image pair. You can move the teapots back and forth by pressing \keys{w} and \keys{s} on the keyboard. Note that the teapot's location is given as the z-component of the model translation, as displayed at the top of the browser window. \pointsin{5}
\end{enumerate}
\begin{answer}
\rule{\textwidth}{0.4pt}
\textbf{Answer:}
Write your answer to this question here.
\rule{\textwidth}{0.4pt}
\end{answer}
\subsubsection*{2.2.3 User-defined Distortion Coefficients \points{10}}
You should be able to decrease/increase $K_1$ with the \keys{2}/\keys{3} keys and decrease/increase $K_2$ with the \keys{4}/\keys{5} keys. This functionality is already implemented for you. You can see the updated values displayed at the top of your screen. By pressing the space bar, you can switch to a scene where a grid pattern is displayed to make it easier to see the distortion effects.
Manually adjust your distortion coefficients $K_1$ and $K_2$ until the lines are as straight as they get throughout your entire field of view. In the PDF submission, report the values ($K_1$, $K_2$) that worked best. Submit one screenshot as well as one photo (e.g., captured with your cellphone) through the lens that show the grid lines before and after distortion correction each. That's four images in total you should submit. Even though multiple sets of the distortion parameters may show equally good results, you can report one set of the best parameters. We will grade based on the photos and your code. After the adjustment, modify the initial distortion coefficients to your adjusted values in \texttt{state} of \texttt{stateController.js}.
\begin{answer}
\rule{\textwidth}{0.4pt}
\textbf{Answer:}
Write your answer to this question here.
\rule{\textwidth}{0.4pt}
\end{answer}
\end{document}