Unformatted text preview:

1MIT EECS 6.837, Cutler and Durand1Ray CastingMIT EECS 6.837, Cutler and Durand2Last Time?• Luxo Jr.• Applications of Computer Graphics• Overview of the semester•IFS– Assignment 0 due tomorrow @ 11:59pm• Questions?MIT EECS 6.837, Cutler and Durand3Notes on Assignments• Make sure you turn in a linux or windowsexecutable (so we can test your program)• Don't use athena dialup• In your README.txt– time spent, collaborators, known bugs, extensions • [email protected] MIT EECS 6.837, Cutler and Durand4Administrivia: Lab & Office Hours•Barb– Mondays 6-8pm in W20-575 •Fredo– Tuesdays 6-7pm in W20-575•Rob– Wednesdays 8-11pm in W20-575• Send email to make an appointment for some other timeMIT EECS 6.837, Cutler and Durand5Overview of Today• Ray Casting Basics• Camera and Ray Generation• Ray-Plane Intersection• Ray-Sphere IntersectionMIT EECS 6.837, Cutler and Durand6Ray CastingFor every pixelConstruct a ray from the eyeFor every object in the sceneFind intersection with the ray Keep if closest2MIT EECS 6.837, Cutler and Durand7ShadingFor every pixel Construct a ray from the eyeFor every object in the sceneFind intersection with the ray Keep if closestShade depending on light and normal vectorMIT EECS 6.837, Cutler and Durand8A Note on Shading• Surface/Scene Characteristics:– surface normal– direction to light– viewpoint• Material Properties– Diffuse (matte)– Specular (shiny)–…• Much more next Thursday!Diffuse sphere Specular spheresNLVMIT EECS 6.837, Cutler and Durand9Ray Tracing• Secondary rays (shadows, reflection, refraction)• In a couple of weeksreflectionrefractionMIT EECS 6.837, Cutler and Durand10Ray TracingMIT EECS 6.837, Cutler and Durand11Ray CastingFor every pixel Construct a ray from the eye For every object in the sceneFind intersection with the rayKeep if closestShade depending on light and normal vectorNFinding the intersection and normal is the central part of ray castingMIT EECS 6.837, Cutler and Durand12Ray Representation?• Two vectors:– Origin– Direction (normalized is better)• Parametric line– P(t) = origin + t * directionorigindirectionP(t)3MIT EECS 6.837, Cutler and Durand13Durer’s Ray Casting Machine• Albrecht Durer, 16thcenturyMIT EECS 6.837, Cutler and Durand14Durer’s Ray Casting Machine• Albrecht Durer, 16thcenturyMIT EECS 6.837, Cutler and Durand15Durer’s Ray Casting Machine• Albrecht Durer, 16thcenturyMIT EECS 6.837, Cutler and Durand16Questions?Henrik Wann Jensen & Stephen DuckMIT EECS 6.837, Cutler and Durand17Overview of Today• Ray Casting Basics• Camera and Ray Generation• Ray-Plane Intersection• Ray-Sphere IntersectionMIT EECS 6.837, Cutler and Durand18CamerasFor every pixelConstruct a ray from the eyeFor every object in the sceneFind intersection with rayKeep if closest4MIT EECS 6.837, Cutler and Durand19Pinhole Camera• Box with a tiny hole• Inverted image• Similar triangles• Perfect image if hole infinitely small• Pure geometric optics• No depth of field issueMIT EECS 6.837, Cutler and Durand20Oldest Illustration • From. R. Gemma Frisius, 1545MIT EECS 6.837, Cutler and Durand21Camera ObscuraMIT EECS 6.837, Cutler and Durand22Camera Obscura TodayAbelardo Morellwww.abelardomorell.netAddicted to LoveMIT EECS 6.837, Cutler and Durand23Camera Obscura in ArtJohannes Vermeer ~1665MIT EECS 6.837, Cutler and Durand24Simplified Pinhole Camera• Eye-image pyramid (frustum)• Note that the distance/size of image are arbitrary5MIT EECS 6.837, Cutler and Durand25Camera Description?• Eye point e (center)• Orthobasis u, v, w (horizontal, up, -direction)• Field of view angle• Image rectangle height, widthMIT EECS 6.837, Cutler and Durand26Perspective vs. Orthographic• Parallel projection• No foreshortening• No vanishing pointperspective orthographicMIT EECS 6.837, Cutler and Durand27Orthographic Camera• Ray Generation?– Origin = center + (x-0.5)*size*horizontal + (y-0.5)*size*up– Direction is constantMIT EECS 6.837, Cutler and Durand28Other Weird Cameras• E.g. fish eye, omnimax, panoramaMIT EECS 6.837, Cutler and Durand29Questions?MIT EECS 6.837, Cutler and Durand30Overview of Today• Ray Casting Basics• Camera and Ray Generation• Ray-Plane Intersection• Ray-Sphere Intersection6MIT EECS 6.837, Cutler and Durand31Ray CastingFor every pixel Construct a ray from the eye For every object in the sceneFind intersection with the ray Keep if closestFirst we will study ray-plane intersectionMIT EECS 6.837, Cutler and Durand32Recall: Ray Representation• Parametric line • P(t) = Ro+ t * Rd• Explicit representationRdRoorigindirectionP(t)MIT EECS 6.837, Cutler and Durand333D Plane Representation?• Plane defined by –Po= (x,y,z)– n = (A,B,C) • Implicit plane equation– H(P) = Ax+By+Cz+D = 0= n·P + D = 0• Point-Plane distance?– If n is normalized, distance to plane, d = H(P)– d is the signed distance!HPonormalPP'H(p) = d < 0H(p) = d > 0MIT EECS 6.837, Cutler and Durand34Explicit vs. Implicit?• Ray equation is explicit P(t) = Ro+ t * Rd– Parametric– Generates points– Hard to verify that a point is on the ray • Plane equation is implicit H(P) = n·P + D = 0– Solution of an equation– Does not generate points– Verifies that a point is on the plane• Exercise: Explicit plane and implicit rayMIT EECS 6.837, Cutler and Durand35Ray-Plane Intersection• Intersection means both are satisfied• So, insert explicit equation of ray into implicit equation of plane & solve for tP(t) = Ro+ t * RdH(P) = n·P + D = 0n·(Ro+ t * Rd) + D = 0t = -(D + n·Ro) / n·RdP(t)MIT EECS 6.837, Cutler and Durand36Additional Housekeeping• Verify that intersection is closer than previous• Verify that it is not out of range (behind eye)P(t) > tminP(t) < tcurrentP(t)7MIT EECS 6.837, Cutler and Durand37Normal• For shading– diffuse: dot product between light and normal• Normal is constantnormalMIT EECS 6.837, Cutler and Durand38Questions?Image by Henrik Wann JensenMIT EECS 6.837, Cutler and Durand39Overview of Today• Ray Casting Basics• Camera and Ray Generation• Ray-Plane Intersection• Ray-Sphere IntersectionMIT EECS 6.837, Cutler and Durand40Sphere Representation?• Implicit sphere equation – Assume centered at origin (easy to translate)– H(P) = P·P - r2 = 0RdRoMIT EECS 6.837, Cutler and Durand41Ray-Sphere Intersection• Insert explicit equation of ray into implicit equation of sphere &


View Full Document

MIT 6 837 - Ray Casting

Documents in this Course
Shadows

Shadows

64 pages

Animation

Animation

37 pages

Radiosity

Radiosity

25 pages

Color

Color

86 pages

InterArch

InterArch

14 pages

Color

Color

15 pages

Animation

Animation

61 pages

Luxo Jr

Luxo Jr

14 pages

Animation

Animation

52 pages

Radiosity

Radiosity

37 pages

Load more
Download Ray Casting
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Ray Casting 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 Ray Casting 2 2 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?