CSC 418/2504 Winter 2002 Assignment 1 Solutions and Marking Guide Sam Hasinoff ta418has@cdf.utoronto.ca 1. [3] Many answers are possible - hair: not detailed enough, moves rigidly and appears glued on - tongue: appears to be missing! - skin: too evenly textured, free of blemishes and veins - eyes: don't twitch or move around realistically - background: appears too uniform and shiny - shadows: too sharp, fail to blend well with background - muscles: seem to move independently - etc. 2(a) [3] YES. The beam hits the ball at about (18.84, 17.84, 16.84) line (x,y,z)=(21,20,19)+(1,1,1)*s (s = t-11) sphere (x-20)^2 + (y-20)^2 + (z-20)^2 = 16 substituting: (s+1)^2 + s^2 + (s-1)^2 = 16 3s^2 = 14 s = +-(14/3)^(1/2) the smaller root corresponds to the first hit (x,y,z) = (21,20,19) + (1,1,1)*(-(14/3)^(1/2)) ~= (18.84, 17.84, 16.84) (b) [3] NO. Converting the point of impact to spherical coords r = 4 phi = acos(z/r) ~= acos( (20-16.84)/4 ) ~= 37.81 degrees > 30 degrees So the beam misses the target area. (c-d) [2] Probability in both cases is 1. Form a plane using the center of the sphere and the first two shots. This will divide the sphere into two hemispheres, with the two shots lying on the "equator" separating the hemispheres. So wherever the third shot lands, all three shots are guaranteed to be in the same hemisphere, regardless of whether the sphere is stationary or moving when it was hit. [explanation in terms of degenerate case: -0.5] 3. [3] Straightforward algebra I1 = I0^(1/g1) I2 = I0^(1/g2) I1^g1 = I0 (invert) I2 = (I1^g1)^(1/g2) (substitute) = I1^(g1/g2) (simplify) 4(a) [3] M = [ 1/5 0 -2/5 ] [ 0 1/4 -3/4 ] [ 0 0 1 ] (b) [3] M = S*T S = [ 1/5 0 0 ] [ 0 1/4 0 ] [ 0 0 1 ] T = [ 1 0 -2 ] [ 0 1 -3 ] [ 0 0 1 ] (c) [Bonus +2] ellipse (x-x0)^2/a^2 + (y-y0)^2/b^2 = 1 Generalizing slightly, we get: M = [ 1/a 0 -x0/a ] [ 0 1/b -y0/b ] [ 0 0 1 ] Applying the transform: (x',y',1) = M(x,y,1) = ((x-x0)/a, (y-y0)/b, 1) which gives x = a*x' + x0 y = b*y' + y0 Subsituting into the ellipse equation (a*x' + x0 - x0)^2/a^2 + (b*y' + y0 - y0)^2/b^2 = 1 (a*x')^2/a^2 + (b*y')^2/b^2 = 1 (x')^2 + (y')^2 = 1 This gives us the equation of the unit circle centered at the origin, in terms of our transformed coordinates, as desired. 5(c) [1] YES, the number of generated triangles is always the same for a polygon of m vertices (it's m-2). Similarly, the number of generated triangles is always the same for a clipped polygon of n vertices (n-2). and m need not be the same as n i.e. clipping can change the number of vertices of a polygon. [missing the n-2 formula: -0.5] (d) [1] YES, you can always scan convert every other triangle. Since the polygon is simple and has no holes, the graph induced by its triangulation will always be acyclic (no loops). So we can always scan convert every other triangle by 2-colouring this graph. (e) [Bonus +3] The number of different triangulations T(n) can be shown to be related to a sequence known as the Catalan numbers. T(n) = CATALAN(n-2) = C(2(n-2), n-2) / (n-1) Where C(n,k) is the combinatorial operator C(n,k) = n!/((n-k)!k!) See, for example: http://mathforum.org/advanced/robertd/catalan.html [full credit also required giving the recurrence used to derive the Catalan numbers, and a reference for this derivation]