Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "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();"— Presentation transcript:

1

2

3

4

5

6

7

8 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

9

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

11

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

13 Q About Rasterization

14

15 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

16 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

17

18

19

20

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

22 Can We Disguise the Facets?

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

24 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

25 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)

26 Interpolation Curves / Splines

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

28

29 [bilinear interpolation]

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

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

32 Nearest, bilinear, b-spline interpolation

33 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 a2t2 + a1t + a0 y(t) = bn-1tn b2t2 + b1t + b0

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

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

36 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.

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

38 Bernstein Polynomials
Cubic Bézier Curve Bernstein Polynomials

39 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

40 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?

41 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.

42 Cubic BSplines

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

44 Bézier is not the same as BSpline

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

46 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

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

48 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)

49 Bicubic Bezier Patch

50 Editing Bicubic Bezier Patches
Curve Basis Functions Surface Basis Functions

51 Modeling with Bicubic Bezier Patches
Original Teapot specified with Bezier Patches

52 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

53 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

54 Subdivision surfaces

55 Doo-Sabin Subdivision

56 Doo-Sabin Subdivision

57 Bezier Patches? or Triangle Mesh? Henrik Wann Jensen

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

59 Loop Subdivision Some edges can be specified as crease edges


Download ppt "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();"

Similar presentations


Ads by Google