Surfaces. Ron Goldman Department of Computer Science Rice University

Similar documents
Section Parametrized Surfaces and Surface Integrals. (I) Parametrizing Surfaces (II) Surface Area (III) Scalar Surface Integrals

CSC418 / CSCD18 / CSC2504

Curves D.A. Forsyth, with slides from John Hart

Geometric Queries for Ray Tracing

1. no trace exists correct. 2. hyperbola : z 2 y 2 = ellipse : y z2 = ellipse : 5. circle : y 2 +z 2 = 2

Intersecting Simple Surfaces. Dr. Scott Schaefer

Curve and Surface Basics

Math 126C: Week 3 Review

Chapter 9. Linear algebra applications in geometry

Calculus III. Math 233 Spring In-term exam April 11th. Suggested solutions

Ray casting. Ray casting/ray tracing

TNM079 Modeling & Animation Lecture 6 (Implicit surfaces)

The diagram above shows a sketch of the curve C with parametric equations

Surfaces. U (x; y; z) = k. Indeed, many of the most familiar surfaces are level surfaces of functions of 3 variables.

Parametric Surfaces. Substitution

Chapter 15: Functions of Several Variables

CS770/870 Spring 2017 Ray Tracing Implementation

Central issues in modelling

4 = 1 which is an ellipse of major axis 2 and minor axis 2. Try the plane z = y2

Quadric Surfaces. Philippe B. Laval. Today KSU. Philippe B. Laval (KSU) Quadric Surfaces Today 1 / 24

Multivariate Calculus Review Problems for Examination Two

Quadric Surfaces. Six basic types of quadric surfaces: ellipsoid. cone. elliptic paraboloid. hyperboloid of one sheet. hyperboloid of two sheets

Quadric Surfaces. Philippe B. Laval. Spring 2012 KSU. Philippe B. Laval (KSU) Quadric Surfaces Spring /

True/False. MATH 1C: SAMPLE EXAM 1 c Jeffrey A. Anderson ANSWER KEY

Name: Class: Date: 1. Use Lagrange multipliers to find the maximum and minimum values of the function subject to the given constraint.

Unit 3 Functions of Several Variables

What you will learn today

MAT175 Overview and Sample Problems

Section 12.2: Quadric Surfaces

12.6 Cylinders and Quadric Surfaces

Constructing Blending Surfaces for Two Arbitrary Surfaces

Ray scene intersections

while its direction is given by the right hand rule: point fingers of the right hand in a 1 a 2 a 3 b 1 b 2 b 3 A B = det i j k

Quadric surface. Ellipsoid

Multivariate Calculus: Review Problems for Examination Two

Background for Surface Integration

Curvilinear Coordinates

8.1 Geometric Queries for Ray Tracing

Sung-Eui Yoon ( 윤성의 )

Vectors and the Geometry of Space

PROBLEMS INVOLVING PARAMETERIZED SURFACES AND SURFACES OF REVOLUTION

5. y 2 + z 2 + 4z = 0 correct. 6. z 2 + x 2 + 2x = a b = 4 π

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

CS348B Lecture 2 Pat Hanrahan, Spring Greeks: Do light rays proceed from the eye to the light, or from the light to the eye?

Implicit Surfaces & Solid Representations COS 426

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Preliminary Mathematics of Geometric Modeling (3)

Grad operator, triple and line integrals. Notice: this material must not be used as a substitute for attending the lectures

3D Rendering and Ray Casting

Section 2.5. Functions and Surfaces

Dr. Allen Back. Nov. 21, 2014

f xx (x, y) = 6 + 6x f xy (x, y) = 0 f yy (x, y) = y In general, the quantity that we re interested in is

Math 209, Fall 2009 Homework 3

Chapter 11. Parametric Equations And Polar Coordinates

Multiple Integrals. max x i 0

REVIEW I MATH 254 Calculus IV. Exam I (Friday, April 29) will cover sections

Solid Modeling. Ron Goldman Department of Computer Science Rice University

Equation of tangent plane: for implicitly defined surfaces section 12.9

Functions of Several Variables

Surfaces and Integral Curves

Descriptive Geometry 2

Dr. Allen Back. Nov. 19, 2014

3D Rendering and Ray Casting

What you will learn today

Directional Derivatives and the Gradient Vector Part 2

3.2 THREE DIMENSIONAL OBJECT REPRESENTATIONS

Curves and Surfaces Computer Graphics I Lecture 10

ü 12.1 Vectors Students should read Sections of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

Practice problems from old exams for math 233 William H. Meeks III December 21, 2009

Implicit Surface Modeling

MATH 261 FALL 2000 FINAL EXAM INSTRUCTIONS. 1. This test booklet has 14 pages including this one. There are 25 questions, each worth 8 points.

GEOMETRIC TOOLS FOR COMPUTER GRAPHICS

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

Curves and Surfaces. CS475 / 675, Fall Siddhartha Chaudhuri

x 6 + λ 2 x 6 = for the curve y = 1 2 x3 gives f(1, 1 2 ) = λ actually has another solution besides λ = 1 2 = However, the equation λ

7/14/2011 FIRST HOURLY PRACTICE IV Maths 21a, O.Knill, Summer 2011

16.6. Parametric Surfaces. Parametric Surfaces. Parametric Surfaces. Vector Calculus. Parametric Surfaces and Their Areas

Kevin James. MTHSC 206 Section 15.6 Directional Derivatives and the Gra

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Curves and Surfaces Computer Graphics I Lecture 9

Lecture 4b. Surface. Lecture 3 1

Topic 5-6: Parameterizing Surfaces and the Surface Elements ds and ds. Big Ideas. What We Are Doing Today... Notes. Notes. Notes

Know it. Control points. B Spline surfaces. Implicit surfaces

Measuring Lengths The First Fundamental Form

Sphere-geometric aspects of bisector surfaces

Second Midterm Exam Math 212 Fall 2010

MATH 2023 Multivariable Calculus

Directional Derivatives and the Gradient Vector Part 2

form. We will see that the parametric form is the most common representation of the curve which is used in most of these cases.

Graphics and Interaction Transformation geometry and homogeneous coordinates

PURE MATHEMATICS 212 Multivariable Calculus CONTENTS. Page. 1. Assignment Summary... i 2. Summary Assignments...2

Math Exam III Review

7/8/2010 FIRST HOURLY PRACTICE II Maths 21a, O.Knill, Summer 2010

WW Prob Lib1 Math course-section, semester year

Lecture 23. Surface integrals, Stokes theorem, and the divergence theorem. Dan Nichols

Workbook. MAT 397: Calculus III

Cylinders and Quadric Surfaces A cylinder is a three dimensional shape that is determined by

7/8/2010 FIRST HOURLY PRACTICE II Maths 21a, O.Knill, Summer 2010

Intersecting a Freeform Surface with a General Swept Surface

Topic 5.1: Line Elements and Scalar Line Integrals. Textbook: Section 16.2

Transcription:

Surfaces Ron Goldman Department of Computer Science Rice University

Representations 1. Parametric Plane, Sphere, Tensor Product x = f (s,t) y = g(s,t) z = h(s,t) 2. Algebraic Plane, Sphere, Torus F(x, y, z) = 0 3. Procedural Fractals (Turtle Programs, Iterated Function Systems), Blends 4. Deformed Ellipsoid, Free-Form Deformations

Advantages and Disadvantages 1. Parametric Generate points on the surface Generate contour lines along the surface 2. Algebraic Point on Surface Test Inside Outside Test 3. Procedural Fractals for modeling natural shapes Difficult to ray trace! 4. Deformed Simple base surface

Problems 1. Converting between different representations a. Parametric to Implicit (Resultants) b. Implicit to Parametric (Difficult) 2. Extracting information from a particular representations a. Surface Normals b. Axes of Symmetry 3. Solving for Intersections a. Ray Surface b. Curve Surface c. Surface Surface 4. Transforming to a different location or shape a. Rigid Motions b. Affine and Projective Transformations c. Non Linear Transformations

1. Algebraic F(x, y, z) = 0 Normals Calculations N = F = F x, F y, F z 2. Parametric ( ) P(s,t) = x(s,t), y(s,t), z(s,t) N = P s P t 3. Fractal??? 4. Transformed P new = P old M N new = N old M T

Algebraic Surfaces Setup F(x, y, z) = 0 Surface ( ) Curve on Surface P(t) = x(t), y(t), z(t) F( x(t), y(t), z(t) ) 0 Constraint Chain Rule F x dx dt + F y dy dt + F z dz dt = df dt = 0 F { { P (t) = F Gradiant x, F y, F z Derivative 14 244 3 Normal vector dx dt, dy dt, dz t 1 42 4 3 Tangent vector = 0 N = F = F x, F y, F z

Parametric Surfaces Tangents and Normals ( ) Surface ( ) Curve on Surface P(s,t) = x(s,t), y(s,t), z(s,t) P(s,t 0 ) = x(s,t 0 ), y(s,t 0 ),z(s,t 0 ) -- P s = x s, y s, z s Tangent Vector P(s 0,t) = ( x(s 0,t), y(s 0,t), z(s 0,t)) Curve on Surface -- P t = N = P s P t x t, y t, z t Tangent Vector Normal Vector

Transformed Surfaces Points and Tangent Vectors P new = P old M Points v new = v old M Tangent Vectors -- v old = Lim h 0 P old (t + h) P old (t) h -- v new = Lim h 0 P new (t + h) P new (t) h Normal Vectors v N T = v N = 0 T (v old M) N new (v old M) (M 1 T N old T = v new N new = 0 ) = T vold N old = 0 T N new = M 1 T N old N new = N old M T

List of Surfaces Planes Quadrics Spheres Ellipsoids Cylinders Cones Tori Extruded Surfaces Cylinders Cones Surfaces of Revolution

Planes Equations Ax + By + Cz + D = 0 N (P Q) = 0 Normal N = (A, B,C) Ray Plane Intersection P(t) = P + tv {ray} N ( P(t) Q) = 0 {solve for t} -- t = N (Q P) N V R = P + tv {compute (x, y, z)}

Point Inside Polygon P 1 P 2 N 23 N 12 Q N 51 P 5 L N 45 N 34 P 3 P 4 Test 1: (Convex Polygons) (Q P i ) N i,i+1 0 for all inward normals N i,i+1 Test 2: (Arbitrary Polygons) #(L Polygon) is odd for any ray L through Q

Quadrics Spheres Cylinders Cones Ellipsoids Paraboloids Hyperboloids

Sphere Equation Distance to Center = Constant P C 2 = R 2 x 2 + y 2 + z 2 = R 2 Normal N = P C Ray Sphere Intersection Algebraic -- Substitution Line Equation into Sphere Equation -- Dangerous Decisions Geometric -- Reduce to Line Circle Intersection -- Robust Decisions and Fast Reject

Line Sphere Intersection Equations P C 2 = R 2 (Sphere) P(t) = At + B (Line) Computation R 2 = P(t) C 2 = At + B C 2 = ( At + B C) ( At + B C) = (A A)t 2 + 2( A (B C) )t + ( B C) ( B C) Solution t = ( A (B C) ) ± ( A (B C) )2 (A A) ( B C) ( B C) R 2 A A { }

Ray Circle Intersection Data C = Circle Center R = Circle Radius P = Point on Line v = Unit Vector for Line Computation w = (P C) = (P C) ((P C) v)v Q = C + w x 2 = R 2 w 2 A = Q + xv B = Q xv R C w R P C x x v A Q B P

Sphere -- Ray Tracing Ray Sphere Intersection Points First check distance between ray and sphere center -- fast reject. If Distance < Radius, -- Compute ray circle intersection points. -- Recover the line parameters from the intersection points. Ray Sphere Intersection Parameters A = P +t 1 v t 1 = (A P) v B = P +t 2 v t 2 = (B P) v

Cylinder Equation Distance to Axis Line = Constant (P Q) A 2 = R 2 x 2 + y 2 = R 2 Normal N = (P Q) {(P Q) A}A Ray Cylinder Intersection First check distance between ray and axis line -- fast reject. Project orthogonally into Q plane and treat as line circle problem. (see sphere) Recover the line parameter to find true intersection points.

Cylinder A N P Q P Q N = (P Q) = (P Q) ((P Q) A)A

Computing True Intersections from Projections Setup L(t) = P + tv (Original Line) L (t) = P + tv (Projected Line) P 0, P1 = Computed Intersection Points -- Projections P 0, P 1 = Original Intersection Points Recovering True Intersections Solve for Intersection Parameters P k = P +tk v t k = (P k P ) v v v Compute Original Intersection Points P k = P + t k v

Cone Equation Distance to Axis Line Distance to Vertex Point = sin(α) (P V) A 2 = P V 2 sin 2 (α) x 2 + y 2 = z 2 Normal N = (P V) P V cos(α) A Ray Cone Intersection Perspective projection from V to a plane normal to A and treat as a line-circle problem (see sphere and cylinder).

Cone A P V cos(α) α α V N P P V N = (P V) P V cos(α) A

Ellipsoid Equation Ellipsoid = Scaled Sphere Ellipsoid = Sphere Scaling Matrix M = Scaling Matrix x 2 a 2 + y 2 b 2 + z2 c 2 =1 Normal N E = N S M T Ray Ellipsoid Intersection Transform Ray by M 1 Intersect Ray with Sphere Transform Ray Sphere Intersection Points by M

Ellipsoid M Sphere x 2 + y 2 + z 2 = 1 Ellipsoid x 2 a 2 + y 2 b 2 + z2 c 2 =1 a 2 0 0 0 0 b 2 0 0 M = 0 0 c 2 0 0 0 0 1

Intersection by Transformation Observation Given a parametric curve and a parametric surface C(t) = Curve S(u, v) = Surface Intersection occurs whenever there are parameters t*,u*,v * such that C(t*)= S(u*,v*). Applying an affine or projective transformation M yields C(t*) M = S(u*,v*) M. Thus if the original curve and surface intersect at t*,u*,v *, so will the transformed curve and surface.

Intersection by Transformation (continued) Conclusions 1. If we do not introduce any new intersections by applying the transformation M, then we can find the original intersections by solving for the parameters t and/or (u,v) of the new transformed curve and surface and then substituting these parameters back into the original equations to find the coordinates of the original intersection points. This is precisely what we do when we solve for the intersection of a line and a cylinder or cone by applying projections into 2 dimensions. 2. Even if we do introduce new intersection points by applying the transformation M, we do not lose any of the old ones. So at worst we need to check whether the parameters representing new intersection points represent original intersection points. This we can do by substituting the parameters back into the original parametric equations and checking whether or not we get the same point on the curve and the surface.

Equation General Quadrics P Q P T = Ax 2 + By 2 + Cz 2 + 2Dxy +L+ J = 0 A D F G D B E H Q = F E C I G H I J = symmetric 4 4 matrix P = (x, y, z,1) = point in homogeneous coordinates Transformations P new = P old M Q new = M 1 Q old M T T P new Q new P new = ( P old M) ( M 1 Q old M T ) ( P old M) T = P old Q old P old T = 0

General Quadrics (continued) Normal Plane P Q R T = 0 P = (x, y, z,1) = arbitrary point Q = symmetric 4 4 matrix R = (r 1, r 2,r 3,1) = point on Q Normal Vector N = R Q N new = N old M T Ray Quadric Intersection Solve a Quadratic Equation R(t) Q R(t) T = 0

Examples of General Quadrics Elliptical Paraboloid x 2 a 2 + y2 b 2 = z Hyperbolic Paraboloid x 2 a 2 y2 b 2 = z Hyperboloid of One Sheet x 2 a 2 y2 b 2 z2 c 2 =1 Hyperboloid of Two Sheets x 2 a 2 + y2 b 2 z2 c 2 =1

Algebraic Surfaces Equation F(x, y, z) = 0 Normal N = F = F x, F y, F z Ray-Algebraic Surface Intersection ( ) = 0 F x(t), y(t), z(t) Examples Quadrics Tori Cyclides

Tori in Canonical Position Equation ( ) 2 + 4d 2 z 2 4a 2 d 2 = 0 F(x, y, z) = x 2 + y 2 + z 2 d 2 a 2 Normal N = F x, F y, F = 4xG(x,y,z),4yG(x,y,z),4z(G(x,y,z)+2d 2 ) z G(x.y, z) = x 2 + y 2 + z 2 d 2 a 2 ( ) Ray-Torus Intersection ( ) = 0 Solve the degree 4 equation F x(t), y(t), z(t) Observe the circular cross sections at z = 0 and z = ±a

Tori in General Position Equation Distance to Circle = Constant 2 (P 14 2 C) 43 A + P C 2 ((P C) A) 2 1444 244443 d { Dist to Plane Dist of Projection to Center Circle Radiaus 2 = a 2 Normal Vector Q = P ((P C) A)A (Project P into Circle Plane) q = Q C = P C 2 ((P C) A) 2 R = C +(d /q)(q C) (Point on Circle Nearest to P) N = P R P R Ray-Torus Intersection Solve quartic equation ((P(t) C) A) 2 + P(t) C 2 (P(t) C) A ( ) 2 d 2 = a 2

A Torus C P C d a R (P C) ((P C) A)A P ((P C) A)A Q

Tori in General Position -- Transformation Approach Data Structure C = Center Point A = Unit Axis Vector d = Central Circle Radius a = Tube Radius Transformation to Canonical Position Translate C to the Origin trans( C) = I 0 C 1 Rotate A to the z-axis rot(u,θ) = cos(θ)i + ( 1 cos(θ) )(u u)+ sin(θ)(u _) u = k A k A cos(θ) = k A

Tori in General Position -- Alternative Approach (continued) Transformations to and from Canonical Position Transformation to Canonical Position M 1 = trans( C) rot(u,θ) Transformation to General Position M = rot(u, θ) trans(c) Ray Torus Intersection Transform Ray by M 1 Intersect Ray with Torus in Canonical Position Transform Intersection Points by M Normal N = N canonical position M T = N canonical position rot(u, θ)

Ray Tracing Transformed Surfaces General Principles If we can ray trace a surface S in canonical position, then we can ray trace the surface R = S in general position. If we can ray trace a surface S, then we can ray trace any affine image R = S M of the surface S. Data Structure for R D = Data Structure for S -- Scalars, Points, Vectors, Equations, K M = Affine Transformation -- 4 4 Matrix Ray-Surface Intersections Transform the ray by M 1 Compute intersections of the transformed ray with S Transform intersection points by M Normals N R = N S M T

Examples Ellipsoids Scaled Spheres Elliptical Cylinders Scaled Cylinders Tori Translated and Rotated from Torus in Canonical Position Elliptical Tori Scaled Tori Translated, Rotated, and Scaled from Torus in Canonical Position

Equation of Transformed Surface Equation F new = F old o M 1 F new (P new ) = 0 F old (P old ) = 0 -- P new = P old M -- F new (P new ) = F old (P new M 1 ) = F old (P old ) = 0 Algorithm Compute M 1. Compute x old,y old,z old in terms of x new,y new,z new. Substitute these equations for x old,y old,z old into the original expression for F old. The resulting expression is F new.

Surfaces of Revolution Parametric Equation R(u,v) = ( f (u)cos(v), f (u)sin(v),g(u)) -- Surface of Revolution D(u) = ( f (u),0, g(u) ) -- Directrix z = g(u) -- Axis (z-axis) Parametric Equation in Arbitrary Position R(u,v) = E + f (u)cos(v)c + f (u)sin(v)b + g(u)a D(u) = E + f (u)c + g(u)a A, B,C orthogonal axes E arbitrary center

Surfaces of Revolution (continued) Examples Cylinder: D(u) = ( 1,0, u) Sphere: D(u) = ( cos(u), 0,sin( u) ) Torus: ( ) D(u) = d + a cos(u),0,a sin(u) Normal N(u,v) = R u R v ( ) N(u,v) = f (u) g (u)cos(v), f (u) g (u)sin(v), f (u) f (u)

Surfaces of Revolution (continued) Equations ( ) -- Surface of Revolution R(u,v) = f (u)cos(v), f (u)sin(v),g(u) ( ) -- Line L(t) = At + B = A x t + B x, A y t + B y, A z t + B z Ray Surface of Revolution Intersection Solve the z equation: A z t + B z = g(u) t = g(u) B z A z {If L(t) is horizontal, then A z = 0 and can solve g(u) = B z for u.} Solve the x, y equations for u, v f 2 (u) = (A x t + B x ) 2 + (A y t + B y ) 2 (solve for u) tan(v) = A yt + B y v = tan 1 A x t + B x A yt + B y A x t + B x

Replacing Trigonometric Functions by Rational Functions Substitutions s = tan(v/ 2) cos(2v) = cos 2 (v) sin 2 (v) = 2cos 2 (v) 1 cos 2 (v / 2) = s 2 +1= tan 2 (v / 2) +1 = sec 2 (v / 2) = cos(v) = 1 s2 1+ s 2 sin(v) = 2s 1+ s 2 1 cos 2 (v /2) = 2 1+ cos(v) 1+ cos(v) 2 Observations Faster computations with rational functions It is often easier to solve polynomial equations than to solve trigonometric equations (e.g. ray tracing, although our ray-surface intersection method solves directly for tan(v))