Ray-Triangle Intersection, Then 3D Modeling & Sketchup

Transcription

Ray-TriangleIntersection, then 3DModeling & SketchupLecture 16,Tuesday October 22th, 2013Ray/Triangle Intersections§ Ray/Triangle intersections are efficient andcan be computed directly in 3D§ They rely on the following implicit definitionof a triangle:P A β ( B A ) γ (C A )β 0, γ 0, β γ 110/24/13 Bruce Draper & J. Ross Beveridge 20122

Implicit Trianglesβ 0.5γ 0.48A10/24/13C-A Bruce Draper & J. Ross Beveridge 20123Solve for implicit intersections§ To find intersection, f(L tU) 0 (slide #4)L tU A β ( B A) γ (C A)§ This is a set of 3 linear equations with 3unknowns: unkowns t, β, γLx tU x Ax β ( Bx Ax ) γ (Cx Ax )Ly tU y Ay β ( By Ay ) γ (Cy Ay )Lz tU z Az β ( Bz Az ) γ (Cz Az )10/24/13 Bruce Draper & J. Ross Beveridge 20124

Push it through § Constants on one side.Lx Ax β ( Bx Ax ) γ (Cx Ax ) tU xLy Ay β ( By Ay ) γ (Cy Ay ) tU yLz Az β ( Bz Az ) γ (Cz Az ) tU z§ Now in Matrix Form( Bx Ax ) (Cx Ax )(By Ay )(Cy Ay ) U y( Bz Az ) (Cz Az )10/24/13 U x U zLx Axβγ Ly AytLz Az Bruce Draper & J. Ross Beveridge 20125SketchUp / SkechUp ProAvailable to CS 410students on WindowsMachines in USB 110.10/24/13 Bruce A. Draper & J. Ross Beveridge 20126

Sketchup History10/24/13 Bruce A. Draper & J. Ross Beveridge 20127Opening Move10/24/13 Bruce A. Draper & J. Ross Beveridge 20128

Templates10/24/13 Bruce A. Draper & J. Ross Beveridge 20129One Rectangular Face§ Exact values in the Dimensions Box.§ You will want to learn to enter values here.10/24/13 Bruce A. Draper & J. Ross Beveridge 201210

Export to .obj format10/24/13 Bruce A. Draper & J. Ross Beveridge 201211Export to .obj format§ Note, this is why you are working towardreading .obj files.10/24/13 Bruce A. Draper & J. Ross Beveridge 201212

When Exporting Consider§ Do you export edges? (generally no)§ Are you two faced? (depends)§ How about only triangles?§ This is particularly easy with rectangles.§ May be helpful depeding upon your ray tracerdesign and what you implement.§ We are not yet ready to say much abouttexture maps10/24/13 Bruce A. Draper & J. Ross Beveridge 201213Add Some Color10/24/13 Bruce A. Draper & J. Ross Beveridge 201214

Making 3D - Extrusion§ Canonical Views§ Rotating Views§ Zooming Views§ Extruding a 2D shape to produce 3D shape§ Selecting parts – faces§ Painting faces§ Removing a face10/24/13 Bruce A. Draper & J. Ross Beveridge 201215

Modeling & Sketchup Lecture 16, Tuesday October 22th, 2013 Ray/Triangle Intersections ! Ray/Triangle intersections are efficient and . 10/24/13 Bruce A. Draper & J. Ross Beveridge 2012 7 Opening Move 10/24/13 Bruce A. Draper & J. Ross Beveridge 2012 8 . Templates 10/24/13 Bruce A. Draper & J. Ross Beveridge 2012 9