CMSC 425 : Sring 28 Dve Mount nd Roger Estmn Prctice Prolems for the First Midterm The midterm will e given in clss on Wed, Aril 4 for Estmn s section nd Thu, Aril 5 for Mount s section. The em will e closed-ook nd closed-notes, ut ou will e llowed one sheet of notes (front nd ck). Disclimer: These re rctice rolems, which hve een drwn from old homeworks nd ems. The do not reflect the ctul length, difficult, or coverge for the em. Prolem. Short nswer questions. Unless otherwise secified, elntions re not required, ut m e rovided for rtil credit. () Suose tht Unit gme oject is declred to e sttic ( checking the Sttic checko in the editor). Which of the following otimiztions cn Unit erform s result? (Indicte True or Flse for ech.) (i) Nvigtion comuttion nd hsics cn e otimized ecuse the oject s osition is fied. (ii) Fewer method clls re needed, ecuse the methods Udte or FiedUdte re never clled on sttic ojects. (iii) Some glol lighting comuttions cn e recomuted. (iv) Sce is sved ecuse ll instntitions of sttic oject refer to the sme (shred) gme oject. () Consider n orthonorml coordinte frme in 3-sce, where,, nd z re the unit vectors. Wht reltionshi holds etween these vectors in order for the frme to e right hnded? (You cn eress our nswer s n eqution involving geometric oertions or s drwing.) (c) You hve long, thin oject (e.g., n rrow) tht cn e oriented ritrril in sce. Which of the following collider shes would NOT e good choice to reresent this oject (Select ll the l). Briefl elin our nswers. (i) Ais-ligned ounding o (AABB) (ii) Generl (ritrril oriented) ounding o (iii) Bounding shere (iv) Csule (d) Consider the following two comuttionl tsks tht rise in nimtion rocessing: Tsk I: Given the lcement of skeletl model in scene nd n ssignment to its joint ngles, determine the osition of oint of the model (e.g., the ti of the inde finger) reltive to the scene s coordinte sstem. Tsk II: Given the lcement of skeletl model in scene nd the desired osition of given oint of the model (e.g., the ti of the inde finger should e touching light switch), determine how to set the joint ngles to chieve this desired result.
(i) One of the ove tsks is n instnce of forwrd kinemtics nd the other is n instnce of inverse kinemtics. Which is which? (ii) Which of these two tsks is comuttionll more chllenging? Briefl justif our nswer. (e) Let S denote the limiting she resulting from the sequence of curves shown in Fig.. Wht is the frctl dimension of this oject? (You m eress our nswer s the rtio of logrithms.) S S S 2 S 3 S... /3 Figure : Prolem (e): Frctl dimension. Prolem 2. Your new 3-dimensionl gme involves throwing Frisee. You need to imlement n efficient collider tht will (roughl) reresent the she of fling disk. You hve chosen to model the Frisee collider s simle flt circulr disk in three dimensionl sce (with zero thickness). The collider is secified three rmeters: () the center oint = (,, z ) of the collider, (2) unit-length norml vector = (u, u, u z ) tht oints in the direction erendiculr to the lne on which the disk lies, nd (3) ositive rel r tht indictes the rdius of the disk (see Fig. 2()). r q q(t) () () (c) (d) Figure 2: Prolem 2: Frisee collider. The ojective of this rolem is to derive rocedure tht, given Frisee collider,, r nd line segment, where = (,, z ) nd = (,, z ), determines whether the Frisee collider intersects the line segment (see Fig. 2()). You m ssume tht nd neither of the oints or lies on the lne tht contins the collider. () The first ste is to determine the eqution of the infinite lne contining the collider disk. A oint q = (,, z) lies on the lne if nd onl if the free vector directed from to q is erendiculr to the vector (see Fig. 2(c)). Use this fct to derive the eqution 2
of the lne. (Hint: The lne eqution cn e eressed in the form α+β+γz+δ = for some sclrs α, β, γ, nd δ. Derive the vlues of these four sclrs s function of the coordintes of nd.) () We showed in clss tht n oint on the infinite line cn e eressed s the ffine comintion ( t) + t, for some rel t. Using our nswer from rt (), derive rocedure (in mthemticl nottion) for comuting the vlue of t where the infinite line hits the collider lne. Let s cll this oint q(t) (see Fig. 2(d)). Also, resent test to determine whether q(t) lies within the (finite) line segment. (c) Your nswer to () should involve division quntit tht deends on the inuts. Under wht conditions (s function of,,, nd/or ) would the divisor(s) e equl to zero? Does the rolem descrition eclude this ossiilit? (If not, wht dditionl ssumtions need to e dded?) (d) Assuming tht q(t) (from rt ()) eists nd lies within the line segment, elin how to determine whether q(t) lies within the collider disk of rdius r (see Fig. 2(d)). Prolem 3. The ojective of this rolem is to derive test for clindricl collider. The collider is defined four rmeters (see Fig. 3()): the center oint = (,, z ) of the collider unit-length vector = (u, u, u z ) tht oints long the centrl is of the clinder ositive rel r tht gives the rdius of the clinder (erendiculr to the centrl is) ositive rel l tht indictes the length of the clinder long its centrl is r l v q v v q v () () (c) Figure 3: Prolem 3: Clinder collider. Our ojective is to derive rocedure tht will determine whether given oint q = (q, q, q z ) lies within the collider (see Fig. 3()). () Given the oints nd q, show (using mthemticl nottion) show how to comute the coordintes of vector v = (v, v, v z ) tht is directed from to q (see the figure ()). () Given our nswer to (), show (using mthemticl nottion) how to decomose v s the sum of two vectors v nd v such tht v is rllel to nd v is erendiculr to (see Fig. 3(c)). 3
(c) Given our nswer to (), show (using mthemticl nottion) how to comute the lengths of the vectors v nd v nd then use these lengths together with r nd l to determine whether q lies within the clinder collider. Prolem 4. You re imlementing footll gme, nd ou wnt to simulte the rocess of qurterck throwing the ll to ss receiver. The receiver is running horizontll cross the field t fied seed of s feet er second, nd the qurterck throws the ll t fied seed of s q feet er second. (You m ssume tht oth of these quntities re ositive.) The qurterck needs to djust the ngle t which the ll is thrown (thus, leding the receiver) so tht the ll rrives t the sme time s the receiver. To simlif mtters, let us do this in the 2-dimensionl lne. Assume tht the qurterck is locted t oint q = (q, q ), nd t the instnt the ll is thrown the receiver is t oint = (, ) directl ove q. Thus, = q nd > q (see Fig. 4). Let l q = q denote the initil distnce etween the qurterck nd receiver, nd ssume tht the receiver moves horizontll to the right. seed = s l q q ϕ seed = s q Figure 4: Prolem 4: Throwing footll. Derive (in mthemticl nottion) rocedure, which given q,, s q nd s, oututs the ngle ϕ > of the direction (reltive to the vector from q to ) t which the qurterck should throw the ll so tht the receiver nd ll rrive t the sme time in the sme lce (ssuming tht the move t their given seeds). You m eress ϕ either in rdins or degrees. In order for our solution to eist, wht ssumtions need to e mde out the reltionshi etween s q nd s? Prolem 5. Consider skeletl model of n rm holding sword in 2-dimensionl sce. Suose tht the ind ose is s shown in Fig. 5(), with the rm nd sword etending horizontll to the right of the shoulder. The shoulder, elow, hnd, nd ti of sword coordinte frmes re clled,, c, nd d, resectivel. It is 6 units from the shoulder to the elow, 7 units from the elow to the hnd, nd 8 units from the hnd to the ti of the sword. () Following the nming convention for the locl ose trnsformtions (given in Lecture 9) eress the following locl ose trnsformtions 3 3 homogeneous mtrices. (In ll cses ssume the rrngement shown in Fig. 5().) (i) T [c d], which trnsltes coordintes in the sword ti frme to the hnd frme. (ii) T [ c], which trnsltes coordintes in the hnd frme to the elow frme. (iii) T [ ], which trnsltes coordintes in the elow frme to the shoulder frme. 4
c d d θ c c θ 6 7 8 () () Figure 5: Prolem 5: Kinemtics for skeletl rm. For emle, the trnsformtion T [c d] should trnsform the column vector denoting the ti of the sword reltive to the ti-of-sword frme coordinte (s the origin) to its reresenttion reltive to the hnd frme coordintes (s ling 8 units long the -is). Tht is, T [c d] = () Show tht multiling these mtrices together in the roer order, we otin mtri T [ d] tht ms oint in the ti-of-sword frme to the shoulder frme. For emle, ecuse the ti lies 2 units to the right of the should, we hve T [ d] = (c) Give the following inverse locl ose trnsformtions: (i) T [d c], which trnsltes coordintes in the hnd frme to the sword ti frme. (ii) T [c ], which trnsltes coordintes in the elow frme to the hnd frme. (iii) T [ ], which trnsltes coordintes in the shoulder frme to the elow frme. (Hint: You cn eloit the simle structure of the mtrices in rt () to void the need for generl mtri inversion.) (d) Suose tht we l rottion ngle θ out the elow nd θ c out the hnd. (These re oth 9 = π/2 in Fig. 5(), ut the cn e n ngle, ositive or negtive, in generl.) Assume tht Rot(θ) denotes 3 3 rottion mtri, tht is Rot(θ) = 8 2.. cos θ sin θ sin θ cos θ Let s ssume tht ll oints re reresented in the shoulder frme. Following the emle in Lecture 9, derive mtri (which ou m eress s the roduct of sequence of mtrices) tht ms oint reresenting the ti of the sword in the ind ose to its. 5
rotted osition. For emle, in the rticulr cse where θ = θ c = 9, this would m the vector (2,, ) to ( 2, 7, ). (Your nswer should work for n vlues of θ nd θ c.) Elin how ou derived our nswer. Prolem 6. Your comn s ltest gme involves wter cnnon, which is used to etinguish fires in urning uildings. We will consider the rolem in 2-dimensionl sce. The cnnon s ind ose is shown in Fig. 6(). It consists of three rottle joints: the se, the elow, nd the rrel. Wter comes out from the nozzle oint. Joint (se joint) is t the origin Joint (elow joint) is 2 units ove the origin Joint c (rrel joint) is 2 units to the right of the elow joint Point (nozzle) is 5 units to the right of the rrel joint elow 2 se 2 5 c rrel nozzle θ θ c θ c () () Figure 6: Prolem 6: Kinemtics for wter cnon. Given the three joint ngles θ, θ, nd θ c, we wnt to determine the loction of nozzle oint (see Fig. 6()). () Wht re the coordintes of the nozzle oint in the ind ose reltive to ech of the following coordinte sstems? Eress ech nswer s 3-element homogeneous vector: (i) Brrel frme: [c] = (ii) Elow frme: [] = (iii) Bse frme: [] = () Eress the following locl-ose trnsformtions s homogeneous 3 3 mtrices. (In ll cses ssume the ind ose shown in Fig. 6().) (i) T [ c] (rrel-frme coordintes to the elow-frme coordintes) (ii) T [ ] (elow-frme coordintes to the se-frme coordintes) (c) Wht is the trnsformtion T [ c] (rrel-frme coordintes to se-frme coordintes)? You m give our nswer s single 3 3 mtri or the roduct of mtrices. 6
(d) Eress the following inverse locl-ose trnsformtions s homogeneous 3 3 mtrices (gin, ssuming the ind ose shown in Fig. 6().) (i) T [c ] (elow-frme coordintes to the rrel-frme coordintes) (ii) T [ ] (se-frme coordintes to the elow-frme coordintes) (e) Suose tht we l rottion ngle θ out the se joint, θ out the elow joint, nd θ c out the rrel joint. Let Rot(θ) denote 3 3 homogeneous rottion mtri, tht is cos θ sin θ Rot(θ) = sin θ cos θ. Present formul (s the roduct of mtrices) tht ms in the ind ose to its osition s result of the rottions. Assume tht nd re oth reresented reltive to the se frme. Tht is, resent mtri M (s the roduct of mtrices) such tht [] = M []. (Hint: It will e fster for ou nd esier for me if ou eress our mtrices nme, e.g. T [ c] rther thn s 3 3 mtri.) Prolem 7. Etending the wter-cnnon rolem, we wnt to develo trgeting tool tht determines where the wter will hit verticl wll. Suose tht the nozzle oint of the wter cnnon is locted h units ove the ground, nd the wter is eing shot with velocit given the vector v = (v,, v, ). The wll is locted l units in front of the cnnon (see Fig. 7). v = (v,, v, ) (t) h = () l Figure 7: Prolem 7: Wter cnon trgeting tool. Suose we turn on the wter t time t =. After consulting stndrd tetook on Phsics, we re reminded tht grvit results in n ccelertion of g 9.8m/s 2, nd fter t time units hve elsed, the osition of rojectile shot t velocit v is given (t) = ((t), (t)), where (t) = v, t nd (t) = h + v, t 2 gt2. As function of h, l, g, nd v, elin how to comute the height t which the wter hits the wll. You m ssume tht the velocit is high enough tht the wter will rech the wll. (Hint: Strt comuting the time it tkes to rech the wll.) Prolem 8. Suose tht we wnted to erform rottion of θ = 6 degrees out unit vector = ( 3, 2 3, 2 3 ) using quternion reresenttion (see Fig. 8). 7
z θ Figure 8: Prolem 8: Quternions. () As function of nd θ, eress this rottion s unit quternion q. (You m eress q s 4-element vector or in the form (s, ), where s is sclr nd is 3-element vector.) Recll tht 3 sin 6 = cos 3 = nd cos 6 = sin 3 = 2 2. (These re the onl trig vlues ou might need.) () Wht is the roduct of the following two quternions? q = (, 2,, ) = + 2i nd q 2 = (, 3, 4, ) = 3i + 4j. Recll the rules of quternion multiliction: i 2 = j 2 = k 2 = ijk = ij = k, jk = i, ki = j. 8