CS 417 Spring 2003 -- Final Exam Solutions ------------------------------------------------------------------------ Problem 1 (b) is troublesome because of the occlusion cycles; the others are sortable and therefore are OK for Painter's. ----------------------------------------------------------------------- Problem 2 The vertices are (1,0), (3/4, 3/4), (0,1), (-3/4, 3/4), (-1,0), (-3/4, -3/4), (0,-1), (3/4, -3/4), ----------------------------------------------------------------------- Problem 3 1 -> ii 2 -> i 3 -> iii ----------------------------------------------------------------------- Problem 4 4.1. It intersects with the plane x + y + z == 1. 4.2. function IntersectOctahedron(Point p, Vector d) tpp1 = ( 1 - (p.x + p.y + p.z)) / (d.x + d.y + d.z); tpp2 = (-1 - (p.x + p.y + p.z)) / (d.x + d.y + d.z); tpm1 = ( 1 - (p.x + p.y - p.z)) / (d.x + d.y - d.z); tpm2 = (-1 - (p.x + p.y - p.z)) / (d.x + d.y - d.z); tmp1 = ( 1 - (p.x - p.y + p.z)) / (d.x - d.y + d.z); tmp2 = (-1 - (p.x - p.y + p.z)) / (d.x - d.y + d.z); tmm1 = ( 1 - (p.x - p.y - p.z)) / (d.x - d.y - d.z); tmm2 = (-1 - (p.x - p.y - p.z)) / (d.x - d.y - d.z); t1 = max(min(tpp1, tpp2), min(tpm1, tpm2), min(tmp1, tmp2), min(tmm1, tmm2)); t2 = min(max(tpp1, tpp2), max(tpm1, tpm2), max(tmp1, tmp2), max(tmm1, tmm2)); if (t1 > 0) return t1; else if (t2 > 0) return t2; else return PLUS_INFINITY; ----------------------------------------------------------------------- Problem 5 5.1. A - blue B - purple / magenta C - green D - yellow 5.2. Two spectra are metamers if they result in the same color (that is, they produce the same response in the human visual system). 5.3. We reproduce colors by using a particular device, such as a color display, to produce a spectrum that is a metamer of the color we're trying to match. ----------------------------------------------------------------------- Problem 6 6.1. No. There are some spectra that would require negative amounts of one or more primaries in order to match them. 6.2. The triple (R, G, B) results in the spectrum a(lm) = R p_r(lm) + G p_g(lm) + B p_b(lm) This results in the cone responses S' = R + G + B M' = R + G + B L' = R + G + B where = integral{f(lm) g(lm) d lm} This can be written as a matrix equation: [S'] [ ] [R] [M'] = [ ] [G] [L'] [ ] [B] OK to omit bounds on the integral or use 400-700 or 380-760. The spectrum s results in the cone responses S = M = L = The RGB values that make S', M', L' == S, M, L are [ ] ^ (-1) [] [ ] [] [ ] [] 6.3. The answer would not change. xbar, ybar, zbar are linear combinations of r_s, r_m, r_l.