solutions to homework #6 wu xiaomao may 27, 2004

11
Solutions to homework #6 Wu Xiaomao May 27, 2004

Upload: anna-casey

Post on 04-Jan-2016

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Solutions to homework #6 Wu Xiaomao May 27, 2004

Solutions to homework #6

Wu Xiaomao

May 27, 2004

Page 2: Solutions to homework #6 Wu Xiaomao May 27, 2004

15.5 Explain for the z-buffer, depth-sort,

Warnock, and BSP-tree algorithms, how piercing

Polygons would be handled. Are they a special

case that must be treated explicitly, or are they

accommodated by the basic algorithm?

Page 3: Solutions to homework #6 Wu Xiaomao May 27, 2004

Z-buffer:

In z-buffer algorithm, polygons get scan converted one after another, the z-buffer and fame buffer are updated when scan-converting each polygon with respected to its z value and color of each pixel. Piercing polygons can be handled by the usual algorithm.

Page 4: Solutions to homework #6 Wu Xiaomao May 27, 2004

Depth-sort

The depth-sort algorithm is a list-priority algorithm and does handle neither piercing nor overlapping polygons. It sorts the polygons by their farthest z value and draws the nearest polygon. When handling piercing polygons, we can just split the polygons into several polygons which do not pierce each other, which can be handled by the ordinary depth-sort algorithm.

Page 5: Solutions to homework #6 Wu Xiaomao May 27, 2004

Warnock Warnock’s algorithm will divide the area around t

he piecing polygons until the resolution of the display device is reached. Then it will use the depth-sort algorithm or z-buffer algorithm to determine which polygon is the nearest at the center of the pixel. So piercing polygons will be treated correctly in standard warnock algorithm, there are no special cases need to be handled.

Page 6: Solutions to homework #6 Wu Xiaomao May 27, 2004

BSP-tree The binary spare partitioning tree algorithm

belongs to list-priority algorithms. It handles piercing polygons in a straight way. The polygons just divide the space into two different spaces so that piercing polygons be cut into two new polygons that are handled accordingly.

Page 7: Solutions to homework #6 Wu Xiaomao May 27, 2004

15.19 When ray tracing is performed, it is typically necessary to compute only whether or not a ray intersects an extent, not what the actual points of intersection are. Complete the ray-sphere intersection equation using the quadratic formula, and show how it can be simplified to determine only whether or not the ray and sphere intersect.

Page 8: Solutions to homework #6 Wu Xiaomao May 27, 2004

Solution:

The original equation

can be written as:

if b2-4ac=0 one intersection point

else if b2-4ac>0 two intersection point

else if b2-4ac<0 don’t intersect

Page 9: Solutions to homework #6 Wu Xiaomao May 27, 2004

15.24 Implement a simple ray tracer for sphere and polygons, including adaptive supersampling(Choose one of the illumination models from Section 16.1) Improve your program’s performance through the use of spatial partitioning or hierarchies of bounding volumes.

Page 10: Solutions to homework #6 Wu Xiaomao May 27, 2004

Marco Kunze Martin Mehlitz

Page 11: Solutions to homework #6 Wu Xiaomao May 27, 2004

Sebastian Nowozin Timo Glaser