Transformations in Ray TracingLinear Algebra Review SessionLast Time:TodayModelingTransformations in ModelingSlide 7Scene DescriptionSimple Scene Description FileClass HierarchyWhy is a Group an Object3D?Simple Example with GroupsAdding MaterialsSlide 14Adding TransformationsClass Hierarchy with TransformationsWhy is a Transform an Object3D?Simple Example with TransformsNested TransformsQuestions?Slide 21Incorporating TransformsPrimitives handle TransformsTransform the RayTransform RayTransforming Points & DirectionsWhat to do about the depth, t1. Normalize direction2. Don't normalize directionSlide 30New component of the Hit classWhy is the Normal important?Visualization of Surface NormalHow do we transform normals?Transform the Normal like the Ray?Slide 36What class of transforms?Transformation for shear and scaleMore Normal VisualizationsSo how do we do it right?Transform tangent vector vCommentSlide 43Slide 44Constructive Solid Geometry (CSG)For example:How can we implement CSG?Collect all the intersectionsImplementing CSG"Fredo's First CSG Raytraced Image"Slide 51Slide 52Simple ShadingAdding Perspective CameraTriangle Meshes (.obj)Acquiring GeometryNext Week:MIT EECS 6.837, Durand and CutlerTransformations in Ray TracingMIT EECS 6.837, Durand and CutlerLinear Algebra Review Session•Tonight!•Room 2-139•7:30 – 9 PMMIT EECS 6.837, Durand and CutlerLast Time:•Simple Transformations•Classes of Transformations•Representation–homogeneous coordinates•Composition–not commutativeMIT EECS 6.837, Durand and CutlerToday•Motivations•Transformations in Modeling•Adding Transformations to our Ray Tracer•Constructive Solid Geometry (CSG)•Assignment 2MIT EECS 6.837, Durand and CutlerModeling•Create / acquire objects•Placing objects•Placing lights•Describe materials•Choose camera position and camera parameters•Specify animation•....Stephen DuckStephen DuckMIT EECS 6.837, Durand and CutlerTransformations in Modeling•Position objects in a scene•Change the shape of objects•Create multiple copies of objects•Projection for virtual cameras•AnimationsMIT EECS 6.837, Durand and CutlerToday•Motivations•Transformations in Modeling–Scene description –Class Hierarchy–Transformations in the Hierarchy•Adding Transformations to our Ray Tracer•Constructive Solid Geometry (CSG)•Assignment 2MIT EECS 6.837, Durand and CutlerScene DescriptionSceneLightsCamera ObjectsMaterials(much more next week)BackgroundMIT EECS 6.837, Durand and CutlerSimple Scene Description FileOrthographicCamera { center 0 0 10 direction 0 0 -1 up 0 1 0 size 5 }Lights { numLights 1 DirectionalLight { direction -0.5 -0.5 -1 color 1 1 1 } }Background { color 0.2 0 0.6 }Materials { numMaterials <n> <MATERIALS> }Group { numObjects <n> <OBJECTS> }MIT EECS 6.837, Durand and CutlerCylinderGroupPlaneSphereConeTriangleClass HierarchyObject3DMIT EECS 6.837, Durand and CutlerWhy is a Group an Object3D?•Logical organization of sceneMIT EECS 6.837, Durand and CutlerSimple Example with GroupsGroup { numObjects 3 Group { numObjects 3 Box { <BOX PARAMS> } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } Group { numObjects 2 Group { Box { <BOX PARAMS> } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } Group { Box { <BOX PARAMS> } Sphere { <SPHERE PARAMS> } Sphere { <SPHERE PARAMS> } } } Plane { <PLANE PARAMS> } }MIT EECS 6.837, Durand and CutlerAdding MaterialsGroup { numObjects 3 Group { numObjects 3 Box { <BOX PARAMS> } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } Group { numObjects 2 Group { Box { <BOX PARAMS> } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } Group { Box { <BOX PARAMS> } Sphere { <SPHERE PARAMS> } Sphere { <SPHERE PARAMS> } } } Plane { <PLANE PARAMS> } }MIT EECS 6.837, Durand and CutlerAdding MaterialsGroup { numObjects 3 Material { <BROWN> } Group { numObjects 3 Box { <BOX PARAMS> } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } Group { numObjects 2 Material { <BLUE> } Group { Box { <BOX PARAMS> } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } Group { Material { <GREEN> } Box { <BOX PARAMS> } Material { <RED> } Sphere { <SPHERE PARAMS> } Material { <ORANGE> } Sphere { <SPHERE PARAMS> } } } Material { <BLACK> } Plane { <PLANE PARAMS> } }MIT EECS 6.837, Durand and CutlerAdding TransformationsMIT EECS 6.837, Durand and CutlerClass Hierarchy with TransformationsObject3DCylinderGroupPlaneSphereConeTriangleTransformMIT EECS 6.837, Durand and CutlerWhy is a Transform an Object3D?•To position the logical groupings of objects within the sceneMIT EECS 6.837, Durand and CutlerSimple Example with TransformsGroup { numObjects 3 Transform { ZRotate { 45 } Group { numObjects 3 Box { <BOX PARAMS> } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } } Transform { Translate { -2 0 0 } Group { numObjects 2 Group { Box { <BOX PARAMS> } Box { <BOX PARAMS> } Box { <BOX PARAMS> } } Group { Box { <BOX PARAMS> } Sphere { <SPHERE PARAMS> } Sphere { <SPHERE PARAMS> } } } } Plane { <PLANE PARAMS> } }MIT EECS 6.837, Durand and CutlerNested TransformsTransform { Translate { 1 0.5 0 } Scale { 2 2 2 } Sphere { center 0 0 0 radius 1 } } Transform { Translate { 1 0.5 0 } Transform { Scale { 2 2 2 } Sphere { center 0 0 0 radius 1 } } } p' = T ( S p ) = TS psame asTranslateScaleTranslateScaleSphereSphereMIT EECS 6.837, Durand and CutlerQuestions?MIT EECS 6.837, Durand and CutlerToday•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 2MIT EECS 6.837, Durand and CutlerIncorporating Transforms1. Make each primitive handle any applied transformations2. Transform the RaysTransform { Translate { 1 0.5 0 } Scale { 2 2 2 } Sphere { center 0 0 0 radius 1 } } Sphere { center 1 0.5
View Full Document