Docsity

Computer Graphics II: Rendering - Spring 2006 Lecture Notes, Study notes of Computer Science

Partial preview of the text

Download Computer Graphics II: Rendering - Spring 2006 Lecture Notes and more Study notes Computer Science in PDF only on Docsity!

CSE

Computer Graphics II, Rendering

Spring 2006 Matthias Zwicker

Last time • Course overview• Ray tracing algorithm• Computing primary rays

Ray tracing pseudocode for all pixels {

computeprimary( &ray )for all objects {

intersect( ray, &hit )if hit is closer than firsthit {

firsthit = hit } } shade( firsthit ) }

Implicit surfaces • Implicit surfaces are defined by• Surface normal• Given a ray• Ray-surface intersection

Parametric surfaces • Parameters• Surface normal• Cross product of tangent vectors

Parametric surfaces • Ray-surface intersection• Easy to solve for parametric planes (see

ray-triangle intersection)

  • Requires iterative solution for most non-

linear surfaces (e.g., NURBS)

Ray-sphere intersection • Surface normal• Unit normal

Ray-triangle intersection^ • Parametric description of a triangle with

vertices

  • Convention: vertices are ordered

counter-clockwise as seen from theoutside

Ray-triangle intersection • Intersection condition• One equation for each coordinate

Ray-triangle intersection • In matrix form• Solve for

using Cramer’s rule

(Shirley page 157)

Ray-polygon intersection • Vertices• Polygon lies on plane• Intersection with ray• Determine whether

lies within the

polygon

Ray-polygon intersection

or

plane

Ray-polyigon intersection

or

plane

Ray-polygon intersection

or

plane