Computer Graphics Homework 4 -- Review Questions CS417/CS418 Fall 1998 Due MONDAY, March 1, 1999 Although the CS417 Part is due MONDAY, March 1 (one day before Prelim 1) the CS418 Part is due FRIDAY, March 5. + Hand in each question SEPARATELY. + Make sure your names are LEGIBLE and EASILY SPOTTED on the front page of each question. (Highlighting/circling helps) + You will be graded on correctness and also clarity and conciseness. + EXACTLY and the SAME ONE of you should write legibly & sign & date the following (fill blanks appropriately) on each question: ``I, ____, CUID# ____, wrote up this assignment; my partner is ____, CUID# ____.'' + E-mail how many total hours PER PERSON you spent on this homework by midnight, Sunday, March 7. Feedback on this homework, Prelim 1, lecture, the textbooks, office hours, etc. is also appreciated. ################# CS417 part -- Review Questions for Prelim 1 ################# Note: On Prelim 1, questions will be broken into smaller parts to let you concentrate on more isolated elements. You will be graded for precision and completeness of details below: Someone not in this class should be able to unambiguously translate your explanation into correct code. 1&2. Explain how to render a scene with multiple spheres and light sources, complete with hidden surface removal via z-buffer, shadows via ray-tracing, and color clipping via global rescaling. Explicitly give all the mathematical formulas (derivations not required). Reminders: ray-sphere intersection, sphere normals, view direction, light direction, reflected light direction, ambient, diffuse, specular, dot products. PLEASE do not give Matlab code or a single block of pseudo-code. Break things up into smaller pieces, and explain in English, pseudo-code, Matlab, and/or math. For example: % hidden surface removal for looking straight down % can be done with a z-buffer as follows: % % for each pixel, record the depth of the closest point % for each object % for each pixel it touches % compute the z-coordinate. % if closer (larger z) then update the z-buffer with z % and store the color of the point into the pixel Then explain how to compute the color of a point on a sphere... 3. Explain how to do morphing between two images of the same size, i.e. how to compute the image at time t (0 <= t <= 1). Assume that there is only one guide line. Do not bother with anti-aliasing. Explicitly give all the mathematical formulas (derivations not required). ################################# CS418 part ################################## 4. Complete the function below. Try to avoid loops. function [w] = morphweight(x,y,P,Q,a,b,p) % w = morphweight(x,y,P,Q,a,b,p). compute morphing weights of points % given column vectors x,y of the same length, % a 2D line segment with endpoints P, Q, % and parameters a,b,p, compute the column vector w of weights % w(i) for each point (x(i),y(i)) according to the Beier-Neeley % weight function ((length^p) / (a + dist))^b, where length is % the length of the line segment PQ, and dist is the distance of % the point to the line segment