Interactive Graphics Lecture 10: Slide 1 Interactive Computer Graphics Lecture 10 Introduction to Surface Construction.

Slides:



Advertisements
Similar presentations
Visualization Techniques -
Advertisements

Lecture Notes #11 Curves and Surfaces II
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 8, 2014 SPLINES CUBIC CURVES HERMITE CURVES BÉZIER CURVES B-SPLINES BICUBIC SURFACES SUBDIVISION SURFACES.
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
Chapter 18 Interpolation The Islamic University of Gaza
Dr. S.M. Malaek Assistant: M. Younesi
EARS1160 – Numerical Methods notes by G. Houseman
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
Spatial Information Systems (SIS)
1 Computer Graphics Chapter 7 3D Object Modeling.
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Designing Parametric Cubic Curves Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Drawing Parametric Curves Jean-Paul Mueller. Curves - The parametric form of a curve expresses the value of each spatial variable for points on the curve.
Modelling: Curves Week 11, Wed Mar 23
RASTER CONVERSION ALGORITHMS FOR CURVES: 2D SPLINES 2D Splines - Bézier curves - Spline curves.
Lecture 9 Interpolation and Splines. Lingo Interpolation – filling in gaps in data Find a function f(x) that 1) goes through all your data points 2) does.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Chapter 10: Curves and Surfaces Part 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Designing Parametric Cubic Curves
Curves and Surfaces (cont’) Amy Zhang. Conversion between Representations  Example: Convert a curve from a cubic B-spline curve to the Bézier form:
Curve Modeling Bézier Curves
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves.
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
V. Space Curves Types of curves Explicit Implicit Parametric.
Curves.
Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.
DigitalTerrainModelling: 1 Digital Terrain Model also known as –digital ground model (DGM) & –digital height model (DHM) a method of representing the.
1 Dr. Scott Schaefer Coons Patches and Gregory Patches.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
Curves. First of all… You may ask yourselves “What did those papers have to do with computer graphics?” –Valid question Answer: I thought they were cool,
Course 13 Curves and Surfaces. Course 13 Curves and Surface Surface Representation Representation Interpolation Approximation Surface Segmentation.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Curves and Surfaces Chapter 10. CS 480/680 2Chapter 9 -- Hierarchical Models Introduction: Introduction: Until now we have worked with flat entities such.
Graphics Lecture 13: Slide 1 Interactive Computer Graphics Lecture 13: Radiosity - Principles.
Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.
Drawing Triangles CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Computer Graphics Rendering 2D Geometry CO2409 Computer Graphics Week 2.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b,
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS Representation of Curves and Surfaces Graphics.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments.
11/6/ :55 Graphics II Introduction to Parametric Curves and Surfaces Session 2.
Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 32 of 42 Wednesday, 11.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
Designing Parametric Cubic Curves 1. 2 Objectives Introduce types of curves ­Interpolating ­Hermite ­Bezier ­B-spline Analyze their performance.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Graphics CSCI 343, Fall 2015 Lecture 34 Curves and Surfaces III.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Introduction to Curves
Graphics Lecture 14: Slide 1 Interactive Computer Graphics Lecture 14: Radiosity - Computational Issues.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Slide 1Lecture Fall ‘00 Surface Modeling Types: Polygon surfaces Curved surfaces Volumes Generating models: Interactive Procedural.
Introduction to Parametric Curve and Surface Modeling.
Lecture 24: Surface Representation
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 SPLINES
Constructing Objects in Computer Graphics By Andries van Dam©
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Spring 2004
Coons Patches and Gregory Patches
CSCE 441: Keyframe Animation/Smooth Curves (Cont.)
Three-Dimensional Object Representation
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

Interactive Graphics Lecture 10: Slide 1 Interactive Computer Graphics Lecture 10 Introduction to Surface Construction

Interactive Graphics Lecture 10: Slide 2 Teapot Subdivision: Russ Fish

Interactive Graphics Lecture 10: Slide 3 Non Parametric Surface Surfaces can be constructed from Cartesian equations directly, and this is acceptable for specific applications, usually involving interpolation. As before a simple polynomial surface is the a quick and easy approach.

Interactive Graphics Lecture 10: Slide 4 Non Parametric Polynomial Surface When multiplied out we have: Because of the symmetry there are 9 scalar unknowns in the equation, so we need to specify nine points through which the surface will pass.

Interactive Graphics Lecture 10: Slide 5 As Before This formulation suffers the same problems as the non-parametric spline curve. It is a fixed surface for a given set of nine points. It has no flexibility for design of surfaces.

Interactive Graphics Lecture 10: Slide 6 Simple Parametric surfaces We can extend the formulation to simple parametric surfaces using the vector equation: There are six vector unknowns: a, b, c, d, e, f

Interactive Graphics Lecture 10: Slide 7 Associating points and parameters We can solve for the six vector unknowns by substituting in six points at known values of and . We might have an arrangement such as: P0P0 P1P1 P4P4 P2P2 P3P3 P5P5 =0 curve =1 curve  =1 curve  =0 curve

Interactive Graphics Lecture 10: Slide 8 Surface equations Substituting this data into the patch equation gives us six equations in the unknowns which we can solve using standard methods. P 0 = f P 1 = d + 2e + f P 2 = a + 2c + f P 3 = a + 2b + 2c + d + 2e + f P 4 = a  + c + f P 5 = a  + b + c + d + 2e + f

Interactive Graphics Lecture 10: Slide 9 Surface Edges We confine  and to the range [0..1]. Thus the contours that bound the patch can be found by substituting either 0 or 1 for one of  or in the patch equation.

Interactive Graphics Lecture 10: Slide 10 The resulting surface P0P0 P1P1 P4P4 P2P2 P3P3 P5P5 =0 curve =1 curve  =1 curve  =0 curve The boundaries are all second order curves and so will be nice and smooth. There is quite a lot of flexibility in this formulation, but it is still only suitable for simple surfaces.

Interactive Graphics Lecture 10: Slide 11 A higher order tensor product Using higher orders gives more variety in shape and better control, but the method is hard to apply and generalise, and so is not usually done.

Interactive Graphics Lecture 10: Slide 12 Cubic Spline Patches The patch method is generally effective in creating more complex surfaces. The idea is, as in the case of the curves, to create a surface by joining a lot of simple surfaces continuously.

Interactive Graphics Lecture 10: Slide 13 Cartesian surface patches - terrain map y z x yzyz yxyx

Interactive Graphics Lecture 10: Slide 14 Points and Gradients At each corner of the patch we need to interpolate the points and set the gradients to match the adjacent patch. There are two gradients yxyx yzyz

Interactive Graphics Lecture 10: Slide 15 Parametric patches In practice we use the more general parametric patch formulation with two parameters  and. The terrain map can be modelled with parametric patches. We need to match three values at each corner:

Interactive Graphics Lecture 10: Slide 16 Corners As usual we adopt the convention that the corners are at parameter values (0,0) (0,1) (1,0) and (1,1)‏ We need to ensure that the patch joins its neighbours exactly at the edges. Hence we ensure that the edge contours are the same on adjacent patches

Interactive Graphics Lecture 10: Slide 17 Edges We do this by designing the edge curves in an identical manner to the cubic spline curve patch. P(0, ) joining P i,j to P i,j+1 P(1, ) joining P i+1,j to P i+1,j+1 P( ,0) joining P i,j to P i+1,j P( ,1) joining P i,j+1 to P i+1,j+1

Interactive Graphics Lecture 10: Slide 18 A parametric spline patch P i+1,j P i,j+1 P i+1,j+1 P i,j  P(0, )‏ P(1, )‏ P( ,0)‏ P( ,1)‏ As long as the gradients are the same for the four patches that meet at a point the surface will join seamlessly

Interactive Graphics Lecture 10: Slide 19 The Coon’s patch To define the internal points we linearly interpolate the edge curves: P( , ) = P( ,0)(1- ) + P( ,1) + P(0, )(1-  ) + P(1, )  - P(0,0)(1- )(1-  ) - P(0,1) (1-  ) - P(1,0)(1- )  - P(1,1)  Substituting values of 0 or 1 for  and/or we can easily verify that the equation goes fits the edge curves.

Interactive Graphics Lecture 10: Slide 20 Polygonisation To draw a spline patch we can simply transform it into polygons. We select a grid of points, eg:   = 0.0, 0.1, 0.2, 0.3,  = 0.0, 0.1, 0.2, 0.3, and triangulate to that grid.

Interactive Graphics Lecture 10: Slide 21 Polygonisation of a patch For speed we can use large polygons with Gouraud or Phong shading. For accuracy we use small polygons, chosen to match the pixel size.

Interactive Graphics Lecture 10: Slide 22 Lofting Surfaces can also be drawn by a technique called lofting (now really obsolete). This means drawing contours of constant  and of constant Algorithms for eliminating the hidden parts have been devised.

Interactive Graphics Lecture 10: Slide 23 Ray tracing a Patch The patch equation is fourth order P( , ) = P( ,0)(1- ) + P( ,1) + P(0, )(1-  ) + P(1, )  - P(0,0)(1- )(1-  ) - P(0,1) (1-  ) - P(1,0)(1- )  - P(1,1)  Hence no closed form solution exists for a ray patch intersection. There are various numeric algorithms.

Interactive Graphics Lecture 10: Slide 24 Numerical Ray-Patch algorithm 1. Polygonise the patch at a low resolution (say 4*4)‏ 2. Calculate the ray intersection with the 32 triangles and find the nearest intersection. 3. Polygonise the immediate area of the insection and calculate a better estimate of the intersection 4. Continue until the best estimate is found

Interactive Graphics Lecture 10: Slide 25 Multiple Roots This algorithm will find a root, but it is not guaranteed to find the nearest root. However, it the object is relatively smooth it should work well in all cases. Note that it will be necessary to do a ray intersection with each patch of the object to find the nearest intersection.

Interactive Graphics Lecture 10: Slide 26 Example of Using a Coon's Patch Part of a terrain map defined on a regular x,y grid is as follows: Find the Coons patch on the centre four points x,  y,

Interactive Graphics Lecture 10: Slide 27 Corners The corners are defined directly in the question: P(0,0) = (9,4,12)‏ P(0,1) = (9,5,11)‏ P(1,0) = (10,4,13)‏ P(1,1) = (10,5,14)‏

Interactive Graphics Lecture 10: Slide 28 Gradients in the x (  ) direction  P/d  (at P(0,0)) = ((10,4,13) - (8,4,10))/2 = (1,0,1.5)‏  P/d  (at P(1,0)) = ((11,4,10) - (9,4,12))/2 = (1,0,-1)‏  P/d  (at P(0,1)) = ((10,5,14) - (8,5,9))/2 = (1,0,2.5)‏  P/d  (at P(1,1)) = ((11,5,11) - (9,5,11))/2 = (1,0,0)‏

Interactive Graphics Lecture 10: Slide 29 Gradients in the y ( ) direction  P/d (at P(0,0)) = ((9,5,11) - (9,3,14))/2 = (0,1,-1.5)‏  P/d (at P(1,0)) = ((9,6,10) - (9,4,12))/2 = (0,1,-1)‏  P/d (at P(0,1)) = ((10,5,14) - (10,3,15))/2 = (0,1,-0.5)‏  P/d (at P(1,1)) = ((10,6,10) - (10,4,13))/2 = (0,1,-1.5)‏

Interactive Graphics Lecture 10: Slide 30 Finding the boundary curves P( ,0) = a 3  3 + a 2  2 + a 1  + a 0 (10,4,13)‏ (9,5,11)‏ (10,4,14)‏ (9,4,12)‏  P(0, )‏ P(1, )‏ P( ,0)‏ P( ,1)‏

Interactive Graphics Lecture 10: Slide 31 Solving for the constants a 0 - a 3 a 0 = (9,4,12)‏ a 1 = (1,0,1.5)‏ a 2 = -3*(9,4,12) - 2*(1,0,1.5) + 3*(10,4,13) - (1,0,1)‏ = (0,0,1)‏ a 3 = 2*(9,4,12) + (1,0,1.5) - 2*(10,4,13) + (1,0,1)‏ = (0,0,0.5)‏

Interactive Graphics Lecture 10: Slide 32 Solving for the curves P( ,1), P(0, ) and P(1, )‏ These curves are found identically to P( ,0). We now have all the individual bits: P( ,0) cubic polynomial in  P( ,1) cubic polynomial in  P( , ) cubic polynomial in P( , ) cubic polynomial in P(0,0), P(0,1), P(1,0), P(1,1)‏ Given  and we can evaluate each of these eight points

Interactive Graphics Lecture 10: Slide 33 So, for any given value for  and we can evaluate the coordinate on the Coon's patch: P( , ) = P( ,0)(1- ) + P( ,1) + P(0, )(1-  ) + P(1, )  - P(0,0)(1- )(1-  ) - P(0,1) (1-  ) - P(1,0)(1- )  - P(1,1) 