transformations in ray tracing mit eecs 6.837, durand and cutler

56
Transformations in Ray T racing MIT EECS 6.837, Durand and Cutler

Upload: mackenzie-brewer

Post on 27-Mar-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Transformations in Ray Tracing

MIT EECS 6.837, Durand and Cutler

Page 2: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Linear Algebra Review Session

• Tonight!

• 7:30 –9 PM

MIT EECS 6.837, Durand and Cutler

Page 3: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Last Time:

Page 4: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Today

• Motivations

• Transformations in Modeling

• Adding Transformations to our Ray Tracer

• Constructive Solid Geometry (CSG)

• Assignment 2

MIT EECS 6.837, Durand and Cutler

Page 5: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Modeling

• Create / acquire objects

• Placing objects

• Placing lights

• Describe materials

• Choose camera position and camera parameters

• Specify animation

• ....

MIT EECS 6.837, Durand and Cutler

Page 6: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Transformations in Modeling

Page 7: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Today

• Motivations• Transformations in Modeling –Scene description –Class Hierarchy –Transformations in the Hierarchy• Adding Transformations to our Ray Tracer• Constructive Solid Geometry (CSG)• Assignment 2

MIT EECS 6.837, Durand and Cutler

Page 8: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Scene Description

Page 9: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Simple Scene Description File

Page 10: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Class Hierarchy

Page 11: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Why is a Group an Object3D?

Page 12: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Simple Example with Groups

Page 13: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Adding Materials

Page 14: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Adding Materials

Page 15: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Adding Transformations

Page 16: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Class Hierarchy with Transformations

Page 17: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Why is a Transform an Object3D?

Page 18: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Simple Example with Transforms

Page 19: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Nested Transforms

Page 20: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Questions?

MIT EECS 6.837, Durand and Cutler

Page 21: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Today

• Motivations• Transformations in Modeling• Adding Transformations to our Ray Tracer – Transforming the Ray –Handling the depth, t –Transforming the Normal • Constructive Solid Geometry (CSG)• Assignment 2• MIT EECS 6.837, Durand and Cutler

Page 22: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Incorporating Transforms

1.Make each primitive handle any applied transformationsSphere { center1 0.5 0 radius 2 }

2.Transform the RaysTransform { Translate { 1 0.5 0 } Scale { 2 2 2 } Sphere { center 0 0 0 radius 1 } } }

Page 23: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Primitives handle Transforms

Page 24: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Transform the Ray

Page 25: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Transform Ray

Page 26: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Transforming Points & Directions

Page 27: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

What to do aboutthe depth, t

If Mincludes scaling, directionOS will

NOT be normalized

1.Normalize the direction

2.Don't normalize the direction

MIT EECS 6.837, Durand and Cutler

Page 28: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

1. Normalize direction

Page 29: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

2. Don't normalize direction

Page 30: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Questions?

MIT EECS 6.837, Durand and Cutler

Page 31: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

New component of the Hit class

Page 32: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Why is the Normal important?

Page 33: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Visualization of Surface Normal

Page 34: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

How do we transform normals?

Page 35: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Transform the Normal like the Ray?

Page 36: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Transform the Normal like the Ray?

Page 37: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

What class of transforms?

Page 38: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Transformation for shear and scale

Page 39: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

More Normal Visualizations

Page 40: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

So how do we do it right?

Page 41: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Transform tangent vector v

Page 42: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Comment

Page 43: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Questions?

MIT EECS 6.837, Durand and Cutler

Page 44: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Today

• Motivations

• Transformations in Modeling

• Adding Transformations to our Ray Tracer

• Constructive Solid Geometry (CSG)

• Assignment 2

MIT EECS 6.837, Durand and Cutler

Page 45: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Constructive Solid Geometry (CSG)

Page 46: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

How can we implement CSG?

Page 47: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Collect all the intersections

Page 48: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Implementing CSG

Page 49: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

"Fredo'sFirst CSG RaytracedImage"

Page 50: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Questions?

MIT EECS 6.837, Durand and Cutler

Page 51: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Today

• Motivations• Transformations in Modeling• Adding Transformations to our Ray Tracer• Constructive Solid Geometry (CSG)• Assignment 2 –Due Wednesday Sept 24th, 11:59pm

MIT EECS 6.837, Durand and Cutler

Page 52: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler
Page 53: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Adding Perspective Camera

Page 54: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Triangle Meshes (.obj)

Page 55: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Acquiring Geometry

• 3D Scanning

(Images removed due to copyright considerations.)

MIT EECS 6.837, Durand and Cutler

Page 56: Transformations in Ray Tracing MIT EECS 6.837, Durand and Cutler

Next Week:

Ray Tracing

Surface reflectance

MIT EECS 6.837, Durand and Cutler