CS4620 A3 Written Scene

Out: Thursday September 24, 2015

Due: Thursday October 8, 2015 at 11:59pm

.

Do this written part alone.

Matrices, Viewing, and Manipulators

We were able to make some really neat images with our ray tracer, but, unfortunately, those images took a long time to compute. You might be wondering how your favorite video game or CAD program is able to create 30-120 images every second. In general, ray tracing is not used for these applications because beautiful looking ray-traced images are too expensive to compute in real time.

Instead, we create 2-D raster images of 3-D scenes by using a graphics pipeline that takes advantage of specialized hardware and linear algebra to create images quickly. In this class, we will use a very popular and mature API called OpenGL to help us make 2-D raster images of 3-D scenes. The purposes of this assignment are to introduce you to transformation matrices in a graphics pipeline, start you thinking about hirearchical modeling, and get you some practice with OpenGL.

In this assignment, you will complete some warm-up exercises, implement a traversal of a scene tree, and implement three types of real-time manipulators. Again, we will provide framework code, so your focus is on implementing the more "interesting," graphics-related components. However, you also have some freedom to redesign our system as you see fit.

Q1. 2-D transformations (with 3x3 matrices)

Consider the following matrices: \[A = \begin{pmatrix} 0.707 & -0.707 & 0 \\ 0.707 & .707 & 0 \\ 0 & 0 & 1 \end{pmatrix} B = \begin{pmatrix} 3 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} C = \begin{pmatrix} 1 & 0 & 2 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{pmatrix}\]
  • What do the matrices A, B, and C represent, in English? (e.g. X represents a rotation by Y degrees, etc.)
  • Consider transforming a 2-dimensional square defined by corner coordinates <(0,0),(0,1),(1,0),(1,1)>. What are the resulting corner coordinates when you transform it by matrix ABC? How about matrix CBA?
  • Why are these different?

    Q2. Big Matrix Stack

    In graphics pipelines, we often apply a series of transformations to coordinates in world space to achieve accurate screen coordinates. In this exercise, the position of a single point in world space is given (in a real graphics pipeline, this might correspond to one of three points that defines a triangle) and it's your job to apply the appropriate matrices to answer the following questions.

    Parameters

    The parameters of our world/camera/scene are specified in accordance with the notation/vocabulary established in Chapter 7 of the textbook. All points are specified using cartesian coordinates in world space.

    Questions

    Here, we'll walk through how a point goes from world space into screen space.

    Q3. Manipulator Warmup

    In this assignment, you're going to be implementing "manipulators." Manipulators allow users to apply transformations to objects in scenes visually. In this question, we will consider a translation manipulator. A translation manipulator can be thought of as a ray in three-dimensional space that corresponds to an object space axis (either x, y, or z) for a given object. One challenge with implementing manipulators is how one maps the actions of users (in a 2-D image plane) to 3-D transformations. We will think of a simplified case -- we are given the coordinates and direction of the manipulator and two click locations on screen. The question we will investigate is: given all of this information, what translation should be applied to the object in question?

    Consider a manipulator as a ray with a given origin o and direction d. Any point p on that ray can be described by a parameter t in the usual p = o + td fashion. For a translation manipulator, the goal is to find the positions on the ray that the user clicked (t1 being the first click point, and t2 being the second). Once we've determined the best t1 and t2, we can then apply a translation transformation on the object in the object's frame along the manipulator's axis by the amount (t2-t1).

    Parameters

    Here are some reference images that might be useful for you to visualize the process of determining t1 and t2.

    Ray Generation

    Point Projection

    Questions

    What to submit

    Submit a pdf containing your solution to CMS.