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();

Slides:



Advertisements
Similar presentations
Curves Jim Van Verth Essential Math for Games Animation Problem: want to replay stored set of transformations  Generated by.
Advertisements

Lecture Notes #11 Curves and Surfaces II
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
Overview June 9- B-Spline Curves June 16- NURBS Curves June 30- B-Spline Surfaces.
© University of Wisconsin, CS559 Spring 2004
Jehee Lee Seoul National University
B-Spline Blending Functions
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
Informationsteknologi Monday, December 10, 2007Computer Graphics - Class 161 Today’s class Curve fitting Evaluators Surfaces.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
Modeling of curves Needs a ways of representing curves: Reproducible - the representation should give the same curve every time; Computationally Quick;
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
1. 2 The use of curved surfaces allows for a higher level of modeling, especially for the construction of highly realistic models. There are several approaches.
Geometric Modeling Surfaces Mortenson Chapter 6 and Angel Chapter 9.
Curves Mortenson Chapter 2-5 and Angel Chapter 9
Bezier and Spline Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Subdivision Primer CS426, 2000 Robert Osada [DeRose 2000]
ENDS 375 Foundations of Visualization Geometric Representation 10/5/04.
Modelling: Curves Week 11, Wed Mar 23
RASTER CONVERSION ALGORITHMS FOR CURVES: 2D SPLINES 2D Splines - Bézier curves - Spline curves.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
COEN Computer Graphics I
1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided.
Curve Surfaces June 4, Examples of Curve Surfaces Spheres The body of a car Almost everything in nature.
Splines III – Bézier Curves
Computer Graphics Lecture 13 Curves and Surfaces I.
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
Bresenham’s Algorithm. Line Drawing Reference: Edward Angel’s book: –6 th Ed. Sections 6.8 and 6.9 Assuming: –Clipped (to fall within the window) –2D.
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.
Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves.
Introduction to Computer Graphics with WebGL
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline.
Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.
INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve.
CS559: Computer Graphics Lecture 24: Shape Modeling Li Zhang Spring 2010.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Splines IV – B-spline Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
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.
Curves and Surfaces 2.0 CSE3AGR - Paul Taylor 2009.
GPH 338 Computer Animation Survey
Keyframing and Splines Jehee Lee Seoul National University.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
Representation of Curves & Surfaces Prof. Lizhuang Ma Shanghai Jiao Tong University.
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.
Rendering Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Angel:
11/26/02(C) University of Wisconsin Last Time BSplines.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
Representation of Curves and Surfaces Chapter 9. Chapter 9 -- Representation of Curves and Surfaces2 u The classic teapot shown here is perhaps one of.
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 30 of 42 Wednesday, 09.
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
CS5500 Computer Graphics May 11, 2006
Representation of Curves & Surfaces
Curves and Surfaces.
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Fall 2004
Rendering Curves and Surfaces
© University of Wisconsin, CS559 Spring 2004
Implicit Functions Some surfaces can be represented as the vanishing points of functions (defined over 3D space) Places where a function f(x,y,z)=0 Some.
UNIT-5 Curves and Surfaces.
Computer Graphics Algorithms Ying Zhu Georgia State University
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

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(); (B) glBegin(GL_QUADS) (C) glBegin(GL_TRIANGLES) glVertex3f(0,0,0); glVertex3f(1,1,0); glVertex3f(1,0,0); glVertex3f(0,1,0); glEnd(); (D) glBegin(GL_QUADS) (E) I just really don’t know

Turn on all pixels inside the triangle But what about pixels on the edge?

Top-Left Rasterization Rule [Rasterization Rules (Direct3D 10) – MSDN]

Q About Rasterization

Q about Normals What is the per-polygon normal shown? 1,1,1 0,0,1 1,0,0 0,1,0 Don’t know

Q about Normals What is the per-vertex normal at point A? 1,1,1 1,1,-1 1/sqrt(3), 1/sqrt(3), 1/sqrt(3) - 1/sqrt(3), 1/sqrt(3),1/sqrt(3) Don’t know

Limitations of Polygonal Meshes Planar facets (& silhouettes) Fixed resolution Deformation is difficult No natural parameterization (for texture mapping)

Can We Disguise the Facets?

Some Non-Polygonal Modeling Tools Extrusion Surface of Revolution Spline Surfaces/Patches Quadrics and other implicit polynomials

Continuity definitions: C0 continuous curve/surface has no breaks/gaps/holes G1 continuous tangent at joint has same direction C1 continuous curve/surface derivative is continuous tangent at join has same direction and magnitude Cn continuous curve/surface through nth derivative is continuous important for shading

Definition: What's a Spline? Smooth curve defined by some control points Moving the control points changes the curve Interpolation Bézier (approximation) BSpline (approximation)

Interpolation Curves / Splines www.abm.org

Linear Interpolation Simplest "curve" between two points Q(t) = Spline Basis Functions a.k.a. Blending Functions

[bilinear interpolation]

Q about bi-linear interpolation What is the value at point A? 1 2 3 4 Don’t know

Interpolation is not just about surfaces, used heavily in images Suppose you start with the smallest image and need a big one?

Nearest, bilinear, b-spline interpolation

Interpolation Curves Curve is constrained to pass through all control points Given points P0, P1, ... Pn, find lowest degree polynomial which passes through the points x(t) = an-1tn-1 + .... + a2t2 + a1t + a0 y(t) = bn-1tn-1 + .... + b2t2 + b1t + b0

Interpolation vs. Approximation Curves curve must pass through control points Approximation curve is influenced by control points

Interpolation vs. Approximation Curves Interpolation Curve – over constrained → lots of (undesirable?) oscillations Approximation Curve – more reasonable?

Cubic Bézier Curve 4 control points Curve passes through first & last control point Curve is tangent at P0 to (P0-P1) and at P4 to (P4-P3) A Bézier curve is bounded by the convex hull of its control points.

Linear Interpolation Simplest "curve" between two points Q(t) = Spline Basis Functions a.k.a. Blending Functions

Bernstein Polynomials Cubic Bézier Curve Bernstein Polynomials

Connecting Cubic Bézier Curves Asymmetric: Curve goes through some control points but misses others How can we guarantee C0 continuity? How can we guarantee G1 continuity? How can we guarantee C1 continuity? Can’t guarantee higher C2 or higher continuity

Connecting Cubic Bézier Curves Where is this curve C0 continuous? G1 continuous? C1 continuous? What’s the relationship between: the # of control points, and the # of cubic Bézier subcurves?

Cubic BSplines ≥ 4 control points Locally cubic Curve is not constrained to pass through any control points A BSpline curve is also bounded by the convex hull of its control points.

Cubic BSplines

Cubic BSplines Can be chained together Better control locally (windowing)

Bézier is not the same as BSpline

Bézier is not the same as BSpline Relationship to the control points is different Bézier BSpline

Converting between Bézier & BSpline original control points as Bézier new BSpline control points to match Bézier new Bézier control points to match BSpline original control points as BSpline

Converting between Bézier & BSpline Using the basis functions:

NURBS (generalized BSplines) BSpline: uniform cubic BSpline NURBS: Non-Uniform Rational BSpline non-uniform = different spacing between the blending functions, a.k.a. knots rational = ratio of polynomials (instead of cubic)

Bicubic Bezier Patch

Editing Bicubic Bezier Patches Curve Basis Functions Surface Basis Functions

Modeling with Bicubic Bezier Patches Original Teapot specified with Bezier Patches

Modeling Headaches Original Teapot model is not "watertight": intersecting surfaces at spout & handle, no bottom, a hole at the spout tip, a gap between lid & base

Cubic Bézier Curve t t t t t t de Casteljau's algorithm for constructing Bézier curves t t t t t t http://www.youtube.com/watch?v=oDzD9bqYsgA&NR=1

Subdivision surfaces

Doo-Sabin Subdivision

Doo-Sabin Subdivision http://www.ke.ics.saitama-u.ac.jp/xuz/pic/doo-sabin.gif

Bezier Patches? or Triangle Mesh? Henrik Wann Jensen

Shirley, Fundamentals of Computer Graphics Loop Subdivision Shirley, Fundamentals of Computer Graphics

Loop Subdivision Some edges can be specified as crease edges http://grail.cs.washington.edu/projects/subdivision/