Unformatted text preview:

CS 418 Homework 3 Assigned Tuesday November 29 2005 Due Tuesday December 6 2005 These questions are intended to help you prepare for the final exam and to review some of the material covered in recent weeks Please be organized when writing your answers to these questions Make sure that all solutions are clearly indicated and labelled with the question they are answering Remember to write clearly and legibly Unreadable answers will receive 0 credit 1 Recall that a Gaussian blob is represented as an implicit surface by the zero set of the function 2 F x e kxk 0 a Given a ray x t p td derive an equation for the value s of t at which the ray intersects this surface b Give the conditions that we must check to determine whether the ray actually hits the surface or not 2 In class we discussed a method for generating shadows by projecting an object through a point onto a plane If the light source which is the focal point of the projection moves to infinity then all light rays become parallel To generate such shadows we must perform parallel projection onto a plane This provides us with a reasonable way to model shadows cast by the sun which for all practical purposes is infinitely far away Suppose you are given some triangulated surface model We want to project every vertex v along the direction d onto the plane n x k 0 Derive the 4 4 matrix which accomplishes this projection d n 3 Consider the following procedure for ray sphere intersection double intersect sphere const Vec3 p const Vec3 d double B 2 p center d double C p center p center radius radius double dis pow B 2 4 C if dis 0 0 return 1 No intersection exists double t0 0 5 B sqrt dis double t1 0 5 B sqrt dis double t min MIN t0 t1 double t max MAX t0 t1 if t min 0 return t min else if t max 0 return t max else return 1 No intersection exists It is needlessly inefficient There are at least 6 distinct instances where efficiency could be improved by eliminating or reformulating expressions Find and justify at least 4 distinct modifications that would clearly and substantially improve the efficiency of this code Note These must be distinct instances For example eliminating the same expression multiple times only counts as 1 improvement Give the code for your new and improved version of this procedure Page 2


View Full Document

U of I CS 418 - Homework #3

Loading Unlocking...
Login

Join to view Homework #3 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 Homework #3 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?