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=(0.707−0.70700.707.7070001)B=(300010001)C=(102011001)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.- Bounding planes for the orthographic view volume: [l,r] x [b,t] x [f,n] = [-10,10] x [-10,10] x [-50,-3]
- Screen size: nx = 100 pixels, ny = 50 pixels
- Camera: e(viewPoint) = (1,1,0), g(viewDir) = (0,-1,1), up(viewUp) = (1,1,0)
- Point of interest: p(in world space) = (5,-20,15)
- We will use a perspective transformation.
Questions
Here, we'll walk through how a point goes from world space into screen space.- Explain briefly what is camera space (1-2 sentences)?
What matrix would you use to transform coordinates from world space to camera space, in this example?
What are the homogeneous coordinates of p in camera space?
- What are the coordinates of p in camera space after applying
the perspective matrix?
Is p in the orthographic view volume?
- Describe what is the canonical view volume, and why do we care about it (1-2 sentences)?
Finally, what are our (x,y) pixel coordinates?
How about our canonical z-coordinate?
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
- The camera is at the origin pointing in the negative z direction, the y-axis is up (as per usual)
- The image plane is a square in the z=-4 plane with side length 5 centered at (0,0,-4).
- The translation manipulator's origin is located at (2,2,-6)
- The translation manipulator is pointing in the direction of (-1,-1,-1). Note that you should normalize this vector such that your final parameter values match ours
- The translation manipulator corresponds to the object's object-space x-axis.
- The user has clicked on world-space coordinates c1 = (1.5,2,-4) and c2 = (-.5,0,-4) [note that these are on the image plane]
Questions
- Our first job is to describe the rays outgoing from the eye intersecting the image plane in the places where the user clicked. What are the equations of the two rays in question?
- Next, we need to find the world coordinates of the points where these rays intersect the plane defined by the translation manipulator's origin and direction. A point and a direction, however, aren't enough to determine a plane -- we need an additional constraint. We want the plane to contain...
- the manipulator's origin
- the manipulator's direction
- a ray perpendicular to the manipulator's ray and parallel to the image plane
- Now we need to find the points on the manipulator ray that are closest to these points. Keeping in mind that points on our ray can be completely described by their associated t parameters, what are t1 and t2?
- Finally, what is the matrix we would apply to translate the object appropriately in its own coordinate space?
What to submit
Submit a pdf containing your solution to CMS.