Last Time? Ray Casting II. Explicit vs. Implicit? Assignment 1: Ray Casting. Object-Oriented Design. Graphics Textbooks

Similar documents
Ray Casting II. Courtesy of James Arvo and David Kirk. Used with permission.

CS-C3100 Computer Graphics, Fall 2016 Ray Casting II Intersection Extravaganza

CS 551 Computer Graphics. Hidden Surface Elimination. Z-Buffering. Basic idea: Hidden Surface Removal

Cameras. Importance of camera models

Doubts about how to use azimuth values from a Coordinate Object. Juan Antonio Breña Moral

Convex Hull Algorithms. Convex hull: basic facts

10.2 Graph Terminology and Special Types of Graphs

8.2 Areas in the Plane

Can Pythagoras Swim?

Section 5.3 : Finding Area Between Curves

Final Exam Review F 06 M 236 Be sure to look over all of your tests, as well as over the activities you did in the activity book

Summer Review Packet For Algebra 2 CP/Honors

Introduction to Algebra

a c = A C AD DB = BD

Lecture 12 : Topological Spaces

Matrices and Systems of Equations

called the vertex. The line through the focus perpendicular to the directrix is called the axis of the parabola.

Calculus Differentiation

GENG2140 Modelling and Computer Analysis for Engineers

Angle Relationships. Geometry Vocabulary. Parallel Lines November 07, 2013

Algebra II Notes Unit Ten: Conic Sections

Today s Lecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Recursive Example. Review: The C / C++ code. Recursive Example (Continued)

Ray surface intersections

AML710 CAD LECTURE 16 SURFACES. 1. Analytical Surfaces 2. Synthetic Surfaces

Review Packet #3 Notes

Width and Bounding Box of Imprecise Points

THE THEORY AND APPLICATION OF STRUCTURED LIGHT PHOTOGRAMMETRY WITH KNOWN ANGLE

ZZ - Advanced Math Review 2017

TOPIC 10 THREE DIMENSIONAL GEOMETRY

EXPONENTIAL & POWER GRAPHS

Tiling Triangular Meshes

)

3D convex hulls. Convex Hull in 3D. convex polyhedron. convex polyhedron. The problem: Given a set P of points in 3D, compute their convex hull

Rigid Body Transformations

MATH 2530: WORKSHEET 7. x 2 y dz dy dx =

Computational geometry

Solutions to Math 41 Final Exam December 12, 2011

Area & Volume. Chapter 6.1 & 6.2 September 25, y = 1! x 2. Back to Area:

MTH 146 Conics Supplement

Section 10.4 Hyperbolas

Lesson 11 MA Nick Egbert

Line The set of points extending in two directions without end uniquely determined by two points. The set of points on a line between two points

Lecture 5: Spatial Analysis Algorithms

5 ANGLES AND POLYGONS

Distance Computation between Non-convex Polyhedra at Short Range Based on Discrete Voronoi Regions

Introduction Transformation formulae Polar graphs Standard curves Polar equations Test GRAPHS INU0114/514 (MATHS 1)

CS-184: Computer Graphics. Today. Clipping. Hidden Surface Removal. Tuesday, October 7, Clipping to view volume Clipping arbitrary polygons

Review Packet #3 Notes

50 AMC LECTURES Lecture 2 Analytic Geometry Distance and Lines. can be calculated by the following formula:

such that the S i cover S, or equivalently S

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.

Introduction to Integration

Graphing Conic Sections

Measurement and geometry

2 Computing all Intersections of a Set of Segments Line Segment Intersection

Simplifying Algebra. Simplifying Algebra. Curriculum Ready.

Fundamentals of Engineering Analysis ENGR Matrix Multiplication, Types

CS 241 Week 4 Tutorial Solutions

Name Date Class. cot. tan. cos. 1 cot 2 csc 2

Angle properties of lines and polygons

MA1008. Calculus and Linear Algebra for Engineers. Course Notes for Section B. Stephen Wills. Department of Mathematics. University College Cork

CS-184: Computer Graphics. Today. Lecture #10: Clipping and Hidden Surfaces ClippingAndHidden.key - October 27, 2014.

s 1 t 4 s 2 4 t 2 a b r 2 r 8 r10 g 4

Stained Glass Design. Teaching Goals:

CMPUT101 Introduction to Computing - Summer 2002

The Basic Properties of the Integral

B. Definition: The volume of a solid of known integrable cross-section area A(x) from x = a

V = set of vertices (vertex / node) E = set of edges (v, w) (v, w in V)

Paradigm 5. Data Structure. Suffix trees. What is a suffix tree? Suffix tree. Simple applications. Simple applications. Algorithms

Geometric transformations

MITSUBISHI ELECTRIC RESEARCH LABORATORIES Cambridge, Massachusetts. Introduction to Matroids and Applications. Srikumar Ramalingam

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.

Essential Question What are some of the characteristics of the graph of a rational function?

2D Projective transformation

Lesson6: Modeling the Web as a graph Unit5: Linear Algebra for graphs

Lecture 11: Interactive Rendering Chapters 7 in Advanced GI

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus

Abstract. Calculation of mirror profile The theory underlying the calculation of the mirror profiles is described below.

Lecture 8: Graph-theoretic problems (again)

HIGH-LEVEL TRANSFORMATIONS DATA-FLOW MODEL OF COMPUTATION TOKEN FLOW IN A DFG DATA FLOW

The Nature of Light. Light is a propagating electromagnetic waves

CHAPTER III IMAGE DEWARPING (CALIBRATION) PROCEDURE

Clinopyroxene. Pyroxene. Clinopyroxene. Compositional Groups

Here is an example where angles with a common arm and vertex overlap. Name all the obtuse angles adjacent to

Order these angles from smallest to largest by wri ng 1 to 4 under each one. Put a check next to the right angle.

MENSURATION-IV

Lecture 13: Graphs I: Breadth First Search

Tight triangulations: a link between combinatorics and topology

The Fundamental Theorem of Calculus

1 Quad-Edge Construction Operators

10.5 Graphing Quadratic Functions

Geometrical reasoning 1

Math/CS 467/667 Programming Assignment 01. Adaptive Gauss Quadrature. q(x)p 4 (x) = 0

PROBLEM OF APOLLONIUS

a < a+ x < a+2 x < < a+n x = b, n A i n f(x i ) x. i=1 i=1

9.1 apply the distance and midpoint formulas

Lesson 4.4. Euler Circuits and Paths. Explore This

1 The Definite Integral

Image interpolation. A reinterpretation of low-pass filtering. Image Interpolation

Topic 3: 2D Transformations 9/10/2016. Today s Topics. Transformations. Lets start out simple. Points as Homogeneous 2D Point Coords

Transcription:

Csting II Lst Time? Csting / Tring Orthogrphi Cmer epresenttion (t) = origin + t * diretion -Sphere Intersetion -lne Intersetion Impliit vs. Epliit epresenttions MIT EECS 6.837, Cutler nd Durnd 1 MIT EECS 6.837, Cutler nd Durnd 2 Epliit vs. Impliit? Epliit rmetri Genertes points Hrd to verif tht point is on the ojet Impliit Solution of n eqution Does not generte points Verifies tht point is on the ojet Assignment 1: Csting Write si r ster Orthogrphi mer Sphere Intersetion Min loop rendering 2 Displ modes: olor nd distne We provide: (origin, diretion) Hit (t, Mteril) Sene rsing MIT EECS 6.837, Cutler nd Durnd 3 MIT EECS 6.837, Cutler nd Durnd 4 Ojet-Oriented Design We wnt to e le to dd primitives esil Inheritne nd virtul methods Even the sene is derived from Ojet3D! Ojet3D ool interset(, Hit, tmin) Grphis Tetooks eommended for 6.837: eter Shirle Fundmentls of Computer Grphis AK eters Tring lne ool interset(, Hit, tmin) Sphere ool interset(, Hit, tmin) Tringle ool interset(, Hit, tmin) Group ool interset(, Hit, tmin) MIT EECS 6.837, Cutler nd Durnd 5 MIT EECS 6.837, Cutler nd Durnd 6

Liner Alger eview Session Questions? Mond Sept. 20 (this Mond!) oom 2-105 (we hope) 7:30 9 M Imge Henrik Wnn Jensen MIT EECS 6.837, Cutler nd Durnd 7 MIT EECS 6.837, Cutler nd Durnd 8 Overview of Tod -Bo Intersetion -olgon Intersetion -Bo Intersetion Ais-ligned Bo: (X 1, Y 1, Z 1 ) (X 2, Y 2, Z 2 ) : (t) = + t -Tringle Intersetion -Bunn Intersetion & etr topis =Y 2 =Y 1 =X 1 =X 2 MIT EECS 6.837, Cutler nd Durnd 9 MIT EECS 6.837, Cutler nd Durnd 10 Nïve -Bo Intersetion 6 plne equtions: ompute ll intersetions eturn losest intersetion inside the o Verif intersetions re on the orret side of eh plne: A+B+C+D < 0 eduing Totl Computtion irs of plnes hve the sme norml Normls hve onl one non-0 omponent Do omputtions one dimension t time =Y 2 =Y 2 =Y 1 =Y 1 =X 1 =X 2 =X 1 =X 2 MIT EECS 6.837, Cutler nd Durnd 11 MIT EECS 6.837, Cutler nd Durnd 12

Test if rllel If = 0 (r is prllel) AND < X 1 or > X 2 no intersetion Find Intersetions er Dimension Clulte intersetion distne t 1 nd t 2 t 1 = (X 1 - ) / t 2 = (X 2 - ) / t 2 =Y 2 =Y 2 t 1 =Y 1 =Y 1 =X1 =X2 =X 1 =X 2 MIT EECS 6.837, Cutler nd Durnd 13 MIT EECS 6.837, Cutler nd Durnd 14 Mintin t ner & t fr Closest & frthest intersetions on the ojet If t 1 > t ner, t ner = t 1 If t 2 < t fr, t fr = t 2 Is there n Intersetion? If t ner > t fr o is missed =Y 2 t ner t fr t 2 =Y 2 t fr t ner t 1 =Y 1 =X1 =X2 =Y 1 =X1 =X2 MIT EECS 6.837, Cutler nd Durnd 15 MIT EECS 6.837, Cutler nd Durnd 16 Is the Bo Behind the Eepoint? eturn the Corret Intersetion If t fr < t min o is ehind If t ner > t min losest intersetion t t ner Else losest intersetion t t fr t fr t fr =Y 2 t ner =Y 2 t ner =Y 1 =Y 1 =X 1 =X 2 MIT EECS 6.837, Cutler nd Durnd 17 =X 1 =X 2 MIT EECS 6.837, Cutler nd Durnd 18

-Bo Intersetion Summr For eh dimension, If = 0 (r is prllel) AND < X 1 or > X 2 no intersetion For eh dimension, lulte intersetion distnes t 1 nd t 2 t 1 = (X 1 - ) / t 2 = (X 2 - ) / If t 1 > t 2, swp Mintin t ner nd t fr (losest & frthest intersetions so fr) If t 1 > t ner, t ner = t 1 If t 2 < t fr, t fr = t 2 If t ner > t fr o is missed If t fr < t min o is ehind If t ner > t min losest intersetion t t ner Else losest intersetion t t fr Effiien Issues 1/, 1/ nd 1/ n e pre-omputed nd shred for mn oes Unroll the loop Loops re ostl (euse of termintion if) Avoid the t ner & t fr omprison for first dimension MIT EECS 6.837, Cutler nd Durnd 19 MIT EECS 6.837, Cutler nd Durnd 20 Questions? Overview of Tod -Bo Intersetion -olgon Intersetion -Tringle Intersetion -Bunn Intersetion & etr topis Imge Henrik Wnn Jensen MIT EECS 6.837, Cutler nd Durnd 21 MIT EECS 6.837, Cutler nd Durnd 22 -olgon Intersetion -plne intersetion Test if intersetion is in the polgon Solve in the 2D plne oint Inside/Outside olgon intersetion definition: Cst r in n diretion (is-ligned is smrter) Count intersetions If odd numer, point is inside Works for onve nd str-shped MIT EECS 6.837, Cutler nd Durnd 23 MIT EECS 6.837, Cutler nd Durnd 24

reision Issue Wht if we interset verte? We might wrongl ount n intersetion for etl one djent edge Deide tht the verte is lws ove the r Winding Numer To solve prolem with str pentgon: Oriented edges Signed ount of intersetions Outside if 0 intersetions + - +- MIT EECS 6.837, Cutler nd Durnd 25 MIT EECS 6.837, Cutler nd Durnd 26 Alterntive Definition Sum of the signed ngles from point to edges ±360, ± 720, point is inside 0 point is outside How Do We rojet into 2D? Along norml Costl Along is Smrter (just drop 1 oordinte) Bewre of degeneries! MIT EECS 6.837, Cutler nd Durnd 27 MIT EECS 6.837, Cutler nd Durnd 28 Questions? Overview of Tod -Bo Intersetion -olgon Intersetion -Tringle Intersetion -Bunn Intersetion & etr topis Imge Henrik Wnn Jensen MIT EECS 6.837, Cutler nd Durnd 29 MIT EECS 6.837, Cutler nd Durnd 30

-Tringle Intersetion Use r-polgon Or tr to e smrter Use rentri oordintes Brentri Definition of lne (α, β, γ) = α + β + γ with α + β + γ =1 Is it epliit or impliit? [Möius, 1827] is the renter: the single point upon whih the plne would lne if weights of sie α, β, & γ re pled on points,, &. MIT EECS 6.837, Cutler nd Durnd 31 MIT EECS 6.837, Cutler nd Durnd 32 Brentri Definition of Tringle (α, β, γ) = α + β + γ with α + β + γ =1 AND 0 < α < 1 & 0 < β < 1 & 0 < γ < 1 How Do We Compute α, β, γ? tio of opposite su-tringle re to totl re α = A /A β = A /A γ = A /A Use signed res for points outside the tringle A A MIT EECS 6.837, Cutler nd Durnd 33 MIT EECS 6.837, Cutler nd Durnd 34 Intuition Behind Are Formul is renter of nd Q A is the interpoltion oeffiient on Q All points on lines prllel to hve the sme α (All suh tringles hve sme height/re) Simplif Sine α + β + γ =1, we n write α =1 β γ (α, β, γ) = α + β + γ rewrite (β, γ) = (1 β γ) + β + γ = + β(-) + γ(-) A A Q Non-orthogonl oordinte sstem of the plne MIT EECS 6.837, Cutler nd Durnd 35 MIT EECS 6.837, Cutler nd Durnd 36

Intersetion with Brentri Tringle Set r eqution equl to rentri eqution (t) = (β, γ) + t * = + β(-) + γ(-) Intersetion if β + γ < 1 & β > 0 & γ > 0 (nd t > t min ) MIT EECS 6.837, Cutler nd Durnd 37 Intersetion with Brentri Tringle + t * = + β(-) + γ(-) + t = + β( - ) + γ( - ) + t = + β( ȳ ) + γ( ȳ ) + t = + β( - ) + γ( - ) egroup & write in mtri form: β o d o γ = t o 3 equtions, 3 unknowns MIT EECS 6.837, Cutler nd Durnd 38 Crmer s ule Used to solve for one vrile t time in sstem of equtions β = o o o A d d d γ = A o o o d d d Advntges of Brentri Intersetion Effiient Stores no plne eqution Get the rentri oordintes for free Useful for interpoltion, teture mpping t = A o o o denotes the determinnt Cn e opied mehnill into ode MIT EECS 6.837, Cutler nd Durnd 39 MIT EECS 6.837, Cutler nd Durnd 40 Questions? Imge omputed using the ADIANCE sstem Greg Wrd Overview of Tod -Bo Intersetion -olgon Intersetion -Tringle Intersetion -Bunn Intersetion & etr topis MIT EECS 6.837, Cutler nd Durnd 41 MIT EECS 6.837, Cutler nd Durnd 42

Tringle Meshes (.oj) verties tringles v -1-1 -1 v 1-1 -1 v -1 1-1 v 1 1-1 v -1-1 1 v 1-1 1 v -1 1 1 v 1 1 1 f 1 3 4 f 1 4 2 f 5 6 8 f 5 8 7 f 1 2 6 f 1 6 5 f 3 7 8 f 3 8 4 f 1 5 7 f 1 7 3 f 2 4 8 f 2 8 6 MIT EECS 6.837, Cutler nd Durnd 43 Aquiring Geometr 3D Snning Digitl Mihelngelo rojet (Stnford) Cerwre MIT EECS 6.837, Cutler nd Durnd 44 reision Wht hppens when Origin is on n ojet? Gring rs? rolem with floting-point pproimtion The evil ε In r tring, do NOT report intersetion for rs strting t the surfe (no flse positive) Beuse seondr rs equires epsilons refletion shdow refrtion MIT EECS 6.837, Cutler nd Durnd 45 MIT EECS 6.837, Cutler nd Durnd 46 The evil ε: hint of nightmre Edges in tringle meshes Must report intersetion (otherwise not wtertight) No flse negtive Construtive Solid Geometr (CSG) Given overlpping shpes A nd B: Union Intersetion Sutrtion MIT EECS 6.837, Cutler nd Durnd 47 MIT EECS 6.837, Cutler nd Durnd 48

For emple: How n we implement CSG? oints on A, Outside of B oints on B, Outside of A oints on B, Inside of A oints on A, Inside of B Union Intersetion Sutrtion MIT EECS 6.837, Cutler nd Durnd 49 MIT EECS 6.837, Cutler nd Durnd 50 Collet ll the intersetions Implementing CSG 1. Test "inside" intersetions: Find intersetions with A, test if the re inside/outside B Find intersetions with B, test if the re inside/outside A Union Intersetion Sutrtion 2. Overlpping intervls: Find the intervls of "inside" long the r for A nd B Compute union/intersetion/sutrtion of the intervls MIT EECS 6.837, Cutler nd Durnd 51 MIT EECS 6.837, Cutler nd Durnd 52 Erl CSG tred Imge Questions? MIT EECS 6.837, Cutler nd Durnd 53 MIT EECS 6.837, Cutler nd Durnd 54

Net week: Trnsformtions MIT EECS 6.837, Cutler nd Durnd 55