CS559: Computer Graphics Lecture 21: Subdivision, Bspline, and Texture mapping Li Zhang Spring 2008.

Slides:



Advertisements
Similar presentations
Computer Graphics (Spring 2008) COMS 4160, Lecture 6: Curves 1
Advertisements

Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 7: Quadric Error Metrics Ravi Ramamoorthi
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
© University of Wisconsin, CS559 Spring 2004
Q about GL to render polygon glBegin(GL_TRIANGLES) glVertex3f(0,0,0); glVertex3f(1,1,0); glVertex3f(1,0,0); glVertex3f(0,1,0); glEnd();
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
Lecture 29 of 42 Bezier Curves and Splines Wednesday, 02 April 2008
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
Splines II – Interpolating Curves
CS CS 175 – Week 9 B-Splines Blossoming, Bézier Splines.
CS CS 175 – Week 9 B-Splines Definition, Algorithms.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 12: Spline Curves (review) Ravi Ramamoorthi Most material.
Computer Graphics (Spring 2008) COMS 4160, Lecture 19: Texture Mapping Many slides from Greg Humphreys, UVA and Rosalee.
(conventional Cartesian reference system)
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 18: Shading & Texture Mapping Many slides from Greg.
Geometric Modeling Surfaces Mortenson Chapter 6 and Angel Chapter 9.
Cubic Bezier and B-Spline Curves
Bezier and Spline Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Texture mapping. Adds realism to computer graphics Texture mapping applies a pattern of color Bump mapping alters the surface Mapping is cheaper than.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008.
Splines III – Bézier Curves
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves.
Texture Mapping by Model Pelting and Blending
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
1 Adding charts anywhere Assume a cow is a sphere Cindy Grimm and John Hughes, “Parameterizing n-holed tori”, Mathematics of Surfaces X, 2003 Cindy Grimm,
CS559: Computer Graphics Lecture 24: Shape Modeling Li Zhang Spring 2010.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
CS 445/645 Fall 2001 Splines/Film/Animation. Final Exam Thursday, December 13 th from 7 – 10 p.m. –Room Olsson 011 You may use one sheet of notes (8.5.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
CS559: Computer Graphics Lecture 19: Curves Li Zhang Spring 2008.
Geometric Modeling using Polygonal Meshes Lecture 3: Discrete Differential Geometry and its Application to Mesh Processing Office: South B-C Global.
Artistic Surface Rendering Using Layout Of Text Tatiana Surazhsky Gershon Elber Technion, Israel Institute of Technology.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
CS559: Computer Graphics Lecture 20: Project 2 Review and Texture mapping Li Zhang Spring 2010 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys,
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.
Review CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2005.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
Computer Graphics (Fall 2003) COMS 4160, Lecture 10: Curves 1 Ravi Ramamoorthi
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 12: Curves 1
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 30 of 42 Wednesday, 09.
Rendering Bezier Curves (1) Evaluate the curve at a fixed set of parameter values and join the points with straight lines Advantage: Very simple Disadvantages:
Kansas State University Department of Computing and Information Sciences CIS 736: Computer Graphics Lecture 13 of 42 Wednesday, 15 February 2006 William.
CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation Li Zhang Spring 2008 Many slides from James Kuffner’s graphics class.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Texture Mapping Greg Humphreys University of Virginia CS 445, Fall 2003.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Introduction to Parametric Curve and Surface Modeling.
© University of Wisconsin, CS559 Spring 2004
CSE 167 [Win 17], Lecture 18: Texture Mapping Ravi Ramamoorthi
CSE 167 [Win 17], Lecture 9: Curves 1 Ravi Ramamoorthi
Texture Mapping COMP575/COMP770.
So Far We have assumed that we know: The point The surface normal
© University of Wisconsin, CS559 Spring 2004
Procedural Animation Lecture 6: Mapping
ATCM 6317 Procedural Animation
Introduction to Parametric Curve and Surface Modeling
Advanced Computer Graphics: Texture
Presentation transcript:

CS559: Computer Graphics Lecture 21: Subdivision, Bspline, and Texture mapping Li Zhang Spring 2008

Today Finish on curve modeling Start Texture mapping Reading – Shirley: Ch – Redbook: Ch 9 – (optional) Moller and Haines: Real-Time Rendering, 3e, Ch 6 Linux: /p/course/cs559- lizhang/public/readings/6_texture.pdf Windows: P:\course\cs559- lizhang\public\readings\6_texture.pdf

Changing u De Casteljau algorithm, Recursive Rendering u=0.5 u=0.25, u=0.5, u=0.75

Subdivision DeCasteljau(float p[N][3], float u) { for (int n = N-1; n >= 1; --n) { for (int j = 0; j < n; ++j) { p[j][0] = (1-u) * p[j][0] + u * p[j+1][0]; p[j][1] = (1-u) * p[j][1] + u * p[j+1][1]; p[j][2] = (1-u) * p[j][2] + u * p[j+1][2]; } //(p[0][0], p[0][1], p[0][2]) saves the result } DeCasteljau(float p[N][3], float u) { for (int n = N-1; n >= 1; --n) { for (int j = 0; j < n; ++j) { p[j][0] = (1-u) * p[j][0] + u * p[j+1][0]; p[j][1] = (1-u) * p[j][1] + u * p[j+1][1]; p[j][2] = (1-u) * p[j][2] + u * p[j+1][2]; } //(p[0][0], p[0][1], p[0][2]) saves the result } DeCasteljau(float p[N][3], float u) { for (int n = N-1; n >= 1; --n) { for (int j = 0; j < n; ++j) { p[j][0] += u*(p[j+1][0]-p[j][0]); p[j][1] += u*(p[j+1][1]-p[j][1]); p[j][2] += u*(p[j+1][2]-p[j][2]); } //(p[0][0], p[0][1], p[0][2]) saves the result } DeCasteljau(float p[N][3], float u) { for (int n = N-1; n >= 1; --n) { for (int j = 0; j < n; ++j) { p[j][0] += u*(p[j+1][0]-p[j][0]); p[j][1] += u*(p[j+1][1]-p[j][1]); p[j][2] += u*(p[j+1][2]-p[j][2]); } //(p[0][0], p[0][1], p[0][2]) saves the result }

Subdivision Given a Bezier curve defined by P 0, P 1, P 2,..., P n we want to find two sets of n+1 control points Q 0, Q 1, Q 2,..., Q n and R 0, R 1, R 2,..., R n such that – the Bézier curve defined by Q i 's is the piece of the original Bézier curve on [0,u] – the Bézier curve defined by R i 's is the piece of the original Bézier curve on [u,1]

Bezier Curve Subdivision p1 p0 p3 p2 u=0.5

Bezier Curve Subdivision p1 p0 p3 p2 u=0.5

A 6 th degree subdivision example

Bezier Curve Subdivision Why is subdivision useful? – Collision/intersection detection Recursive search – Good for curve editing and approximation

Open Curve Approxmiation

Closed Curve Approximation

Interpolate control points Has local controlC2 continuity Natural cubicsYesNoYes Hermite cubicsYes No Cardinal CubicsYes No Bezier CubicsYes No

Interpolate control points Has local controlC2 continuity Natural cubicsYesNoYes Hermite cubicsYes No Cardinal CubicsYes No Bezier CubicsYes No Bspline CurvesNoYes

Bsplines Given p1,…pn, define a curve that approximates the curve. If b i (t) is very smooth, so will be f If b i (t) has local support, f will have local control

Uniform Linear B-splines b 1 (t) b 2 (t) b 3 (t) p1p1 p2p2 pnpn

How can we make the curve smooth? Convolution/filtering Box(t) t

Uniform Quadratic B-splines

Uniform Cubic Bspline

Uniform B-splines Why smoother? – Linear = box filter  box filter – Quadric = linear  box filter – Cubic = quadric  box filter Sum = 1 property, translation invariant Local control C(k-2) continuity

Interpolate control points Has local controlC2 continuity Natural cubicsYesNoYes Hermite cubicsYes No Cardinal CubicsYes No Bezier CubicsYes No Bspline CurvesNoYes

Texture Mapping Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee Wolfe, DePaul tutorial teaching texture mapping visually

Texture Mapping Important topic: nearly all objects textured – Wood grain, faces, bricks and so on – Adds visual detail to scenes Polygonal model With surface texture

Adding Visual Detail Basic idea: use images instead of more polygons to represent fine scale color variation

Parameterization geometry + = image texture map Q: How do we decide where on the geometry each color from the image should go?

Option: Varieties of mappings [Paul Bourke]

Option: unfold the surface [Piponi2000]

Option: make an atlas [Sander2001] chartsatlassurface

Outline Types of mappings Interpolating texture coordinates Broader use of textures

How to map object to texture? To each vertex (x,y,z in object coordinates), must associate 2D texture coordinates (s,t) So texture fits “nicely” over object

Implementing texture mapping A texture lives in it own abstract image coordinates paramaterized by (u,v) in the range ([0..1], [0..1]): It can be wrapped around many different surfaces: Note: if the surface moves/deforms, the texture goes with it.

How to map object to texture? To each vertex (x,y,z in object coordinates), must associate 2D texture coordinates (s,t) So texture fits “nicely” over object

Planar mapping Like projections, drop z coord (u,v) = (x/W,y/H) Problems: what happens near silhouettes?

Cylindrical Mapping Cylinder: r, θ, z with (u,v) = (θ/(2π),z) – Note seams when wrapping around (θ = 0 or 2π)

Basic procedure First, map (square) texture to basic map shape Then, map basic map shape to object – Or vice versa: Object to map shape, map shape to square Usually, this is straightforward – Maps from square to cylinder, plane, … – Maps from object to these are simply coordinate transform

Spherical Mapping Convert to spherical coordinates: use latitude/long. – Singularities at north and south poles

Cube Mapping