1 Course Syllabus 2 I. Image processing 3D Adam Finkelstein Princeton University C0S 426, Fall 2001 II. III. Modeling IV. Animation Image Processing (Rusty Coleman, CS426, Fall99) (Michael Bostock, CS426, Fall99) Modeling (Dennis Zorin, CalTech) Animation (Angel, Plate 1) Where Are We ow? 3 4 I. Image processing Generate an image from geometric primitives II. III. Modeling IV. Animation Image Processing (Rusty Coleman, CS426, Fall99) (Michael Bostock, CS426, Fall99) Geometric Primitives Raster Image Modeling (Dennis Zorin, CalTech) Animation (Angel, Plate 1) 3D Example 5 6 What issues must be addressed by a 3D rendering system? 1
» 3D scene representation How is the 3D scene described in a computer? 7 3D Scene Representation Scene is usually approximated by 3D primitives ο Point ο Line segment ο Polygon ο Polyhedron ο Curved surface ο Solid object ο etc. 8 3D Point Specifies a location ο Represented by three coordinates ο Infinitely small Coordinate x; Coordinate y; Coordinate z; } Point; (x,y,z) 9 3D Vector Specifies a direction and a magnitude ο Represented by three coordinates ο Magnitude V = sqrt(dx dx + dy dy + dz dz) ο Has no location Coordinate dx; Coordinate dy; Coordinate dz; } Vector; Dot product of two 3D vectors ο V 1 V 2 =dx 1 dx 2 +dy 1 dy 2 +dz 1 dz 2 ο V 1 V 2 = V 1 V 2 cos(θ) Θ (dx 1,dy 1,dz 1 ) 10 (dx 2,dy 2,dz 2 ) 3D Line 11 3D Ray 12 Line segment with both endpoints at infinity»p= +tv, (- <t< ) Point P1; Vector V; }Line; V Line segment with one endpoint at infinity»p= +tv, (0<=t< ) Point P1; Vector V; }Ray; V 2
3D Line Segment Specifies a linear combination of two points»p= +t(p 2 - ), (0 t 1) Point P1; Point P2; } Segment; P 2 13 3D Plane Specifies a linear combination of three points ο Implicit representation:»p +d=0,or =(a,b,c)»ax+by+cz+d=0 Vector ; Distance d; } Plane; ο is the plane normal» Unit-length vector» Perpendicular to plane P 2 d P 3 14 3D Polygon Area inside a sequence of coplanar points ο Triangle ο Quadrilateral ο Convex ο Star-shaped ο Concave ο Self-intersecting Point *points; int npoints; } Polygon; Points are in counter-clockwise order ο Holes (use > 1 polygon struct) 15 3D Sphere All points at distance r from point (c x,c y,c z ) ο Implicit representation:»(x-c x ) 2 +(y-c y ) 2 +(z-c z ) 2 =r 2» x = r cos(φ) cos(θ) +c x» y = r cos(φ) sin(θ) +c y»z=rsin(φ) +c z r Point center; Distance radius; } Sphere; 16 3D Geometric Primitives 17 18 More detail on 3D modeling later in course ο Point ο Line segment ο Polygon ο Polyhedron ο Curved surface ο Solid object ο etc.» 3D viewer representation How is the viewing device described in a computer? H&B Figure 10.46 3
Camera Models 19 Camera Parameters 20 The most common model is pin-hole camera ο All captured light rays arrive along paths toward focal point without lens distortion (everything is in focus) ο Sensor response proportional to radiance Other models consider... Depth of field Motion blur Lens distortion View plane Eye position (focal point) Position ο Eye position (px, py, pz) Orientation ο View direction (dx, dy, dz) ο Up direction (ux, uy, uz) Aperature ο Field of view (xfov, yfov) Film plane ο Look at point ο View plane normal back right Up direction Eye Position View direction View Plane Look at Point Moving the camera 21 22 Up Back Towards» Visible surface determination Right How can the front-most surface be found with an algorithm? View Frustum Demo Visible Surface Determination The color of each pixel on the view plane depends on the radiance emanating from visible surfaces 23 Ray Casting For each sample ο Construct ray from eye position through view plane ο Find first surface intersected by ray through pixel ο Compute color of sample based on surface radiance 24 Rays through view plane Simplest method is ray casting Eye position View plane 4
Ray Casting For each sample ο Construct ray from eye position through view plane ο Find first surface intersected by ray through pixel ο Compute color of sample based on surface radiance 25 Visible Surface Determination For each sample ο Construct ray from eye position through view plane ο Find first surface intersected by ray through pixel ο Compute color of sample based on surface radiance 26 More efficient algorithms utilize spatial coherence! Algorithms 27 28 is a problem in sampling and reconstruction!» Lighting simulation Howdowecomputethe radiance for each sample ray? Lighting Simulation 29 Lighting Simulation 30 Lighting parameters ο Light source emission ο Surface reflectance ο Atmospheric attenuation ο Camera response Surface Light Source Direct illumination ο Ray casting ο Polygon shading Global illumination ο Ray tracing ο Monte Carlo methods ο Radiosity methods Surface Light Source More on these methods later! Camera Camera 5
Summary 31 ext Lecture 32 Major issues in 3D rendering ο 3D scene representation ο 3D viewer representation ο Visible surface determination ο Lighting simulation Ray intersections Light and reflectance models Indirect illumination Concluding note ο Accurate physical simulation is complex and intractable» algorithms apply many approximations to simplify representations and computations Render Boy (R. Kalnins & H. Oki, Assignment 5, CS 426, Fall98, Princeton University) For assignment #2, you will write a ray tracer! 6