DOC PREVIEW
CMU CS 15462 - Written Assignment

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Written Assignment #1: Transformation and Viewing15-462 Graphics I, Fall 2003Doug JamesDue: Thursday, September 18, 2003 (before lecture)60 POINTSOctober 7, 2003• The work must be all your own.• The assignment is due before lecture on Thursday, September 18.• Be explicit, define your symbols, and explain your steps. This will make it a lot easier for us to assignpartial credit.• Use geometric intuition together with trigonometry and linear algebra.• Verify whether your answer is meaningful with a simple example.1 Angel, Chapter 4, Exercise 4.2Two transformations, A and B, are said to commute if AB = BA. Show that the following transformationsequences commute:1. A rotation and a uniform scaling;If the scaling matrix is uniform then S = αI, so thatRS = RS(α, α, α) = Rα = αR = SR2. Two rotations about the same axis;It is sufficient to consider Rx(θ). If we multiply and use the standard trigonometric identitiesfor the sine and cosine of the sum of two angles, we will findRx(θ)Rx(φ) = Rx(θ + φ).13. Two translations.This can be shown by simply multiplying the translation matrices and observing thatT (x1, y1, z1)T (x2, y2, z2) = T (x1+ x2, y1+ y2, z1+ z2)2 Angel, Chapter 4, Exercise 4.7Show that any sequence of rotations and translations can be replaced by a single rotation about the origin,followed by a translation.We can show by simply multiplying 4-by-4 matrices that the concatenation of two rotations yieldsa rotation and that the concatenation of two translations yields a translation. By looking at theproduct of a rotation and a translation, we find left three columns of RT are the left three columnsof R and the right column of RT is the right right column of the translation matrix. If we nowconsider RT R0where R0is a 4-by-4 rotation matrix, the left three columns are exactly the same asthe left three columns of RR0and the and right column still has 1 as its bottom element. Thus, theform is the same as RT with an altered rotation (which is the concatenation of the two rotations)and an altered translation. Inductively, we can see that any further concatenations with rotationsand translations do no alter this form.3 Angel, Chapter 4, Exercise 4.8Derive the shear transformation from the rotation, translation, and scaling transformations.A shear transformation A can be interpreted as a rotation, followed by a nonuniform scaling, fol-lowed by another rotation. In fact, you can see this immediately if you consider the Singular ValueDecomposition (see “Matrix Computations” by Golub and Van Loan), A = U SVTwhere both Uand V are orthogonal (rotation) matrices, and S is a diagonal scaling matrix.It is sufficient to consider 2D shear (3D is analogous), and for the case of a shear alonga particular axis. A particularly nice identity for shear in the y-direction (x-direction is just thetranspose) factorized into rotation*scaling*rotation is1 0a −1a1=1√1 + a21 −aa 1a 001aa 1−1 a1√1 + a2.This can be interpreted as follows. If we consider an angle α such that tan α =1a, then (usingsin α =1√1+s2and cos α =s√1+s2) the rotation matrixR(α) =cos α −sin αsin α cos α=1√1 + a2a −11 acan be used to observe that the last rotation matrix is just R(−α). We can also observe thatR(π2− α) =sin α −cos αcos α sin α=1√1 + a21 −aa 1.2Therefore the shear factorization isR(−α)a 001aR(π2− α).Note that unless α =π4⇔ a = 1, and hence the shear is simply the identity, the second rotation isnever simply the inverse of the first.For more details see the article: Ned Greene, “Transformation Identities,” in Graphics Gems I,Edited by Andrew Glassner, 1990, p.485.4 Angel, Chapter 4, Exercise 4.9In two dimensions, we can specify a line by the equation y = mx + b.1. Find an affine transformation to reflect two-dimensional points about this line.This transformation can be constructed in stages. If we do a translation, T , by −bˆy we convertthe problem to reflection about a line passing through the origin; the translation matrix isT =1 0 00 1 −b0 0 1.From the slope, m = tan θ, we can find a rotation so the line is aligned with the x (or y) axis:R = R(−θ) =cos θ sin θ 0−sin θ cos θ 00 0 1.Now apply a reflection, S, about the x (or y) axis,S =1 0 00 −1 00 0 1.Finally we undo the rotation and translation so the sequence is of the formT−1R−1SRT =cos 2θ sin 2θ −b sin 2θsin 2θ −cos 2θ b cos 2θ0 0 1. (1)For verification purposes, notice that when b = m = 0, the matrix correctly simplifies to S.2. Extend your result to reflection about a plane in three dimensions.Let the plane be given by0 = ax + by + cz + d = nTp + dwhere n = (a, b, c)Tand p = (x, y, z)T. Note that some (but not all) of a,b, or c may bezero. Let’s do something slightly different (and more robust) than with the 2D example. First,given p, we can find its projection¯p on the plane,¯p = p − tn3so thatp = ¯p + tnwhere we find t by substituting¯bfp into the plane equation,t =d + nTpnTn.Next we simply flip the sign on the distance offset, t, to determine the reflection:preflected=¯p − tn= p − 2tn= p − 2d + nTpnTnn=I − 2nnTnTnp −dnTnnwhich can be written as an affine transformation.5 Angel, Chapter 4, Exercise 4.20Given two nonparallel three-dimensional vectors, u and v, how can we form an orthogonal coordinate systemin which u is one of the basis vectors?The vector a = u × v is orthogonal to u and v. The vector b = u × a is orthogonal to u and a.Hence, u, a and b form an orthogonal coordinate system.6 Angel, Chapter 4, Exercise 4.22Find the quaternions for 90-degree rotations about the x- and y-axes. Determine their product. What rotationis this?Using r = (cosθ2, sinθ2v) with θ =π2and v = (1, 0, 0), we find for rotation about the x-axisrx=1√2(1, 1, 0, 0).Likewise, for rotation about the y-axis,ry=1√2(1, 0, 1, 0).From the definition of quaternion multiplication (see §4.11.1), we have thatrxry= (12,12(ˆx + ˆy + ˆz))or, depending on how the question was interpreted, you may haveryrx= (12,12(ˆx + ˆy − ˆz)).Note that these are both unit quaternions, and they correspond to 30 degree rotations (sincecosθ2=12→ θ =2π3) about the axes (ˆx + ˆy + ˆz) and (ˆx + ˆy − ˆz), respectively.47 Angel, Chapter 5, Perspective ProjectionIn §5.9, it is shown that the OpenGL perspective transformation can be factored


View Full Document

CMU CS 15462 - Written Assignment

Download Written Assignment
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Written Assignment and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Written Assignment 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?