Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 32 of 42 Wednesday, 11.

Similar presentations


Presentation on theme: "Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 32 of 42 Wednesday, 11."— Presentation transcript:

1 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 32 of 42 Wednesday, 11 April 2008 William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://snipurl.com/1y5gchttp://snipurl.com/1y5gc Course web site: http://www.kddresearch.org/Courses/CIS636http://www.kddresearch.org/Courses/CIS636 Instructor home page: http://www.cis.ksu.edu/~bhsuhttp://www.cis.ksu.edu/~bhsu Readings: Sections 12.2 – 12.5, 12.7, Eberly 2 e – see http://snurl.com/1ye72http://snurl.com/1ye72 No class Friday, 18 Apr 2008 (lab next Monday) Surfaces 2: Bicubic Surfaces

2 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Surface Modelling © 2007 McCaul, B., City University Dublin CA433 Computer Graphics I

3 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Many real-world objects are inherently smooth, therefore need infinitely many points to model it. This is not feasible for a computer with finite storage. More often we merely approximate the object with pieces of planes, spheres, or other shapes that are easy to describe mathematically. We will introduce two most common representations for 3D surfaces: polygon mesh surfaces and parametric surfaces. We will also discuss parametric curves since parametric surfaces are a generalisation of the curves. Modelling the Elegant Teapot © 2007 McCaul, B., City University Dublin CA433 Computer Graphics I

4 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Polygon Meshes VERTEX TABLE V 1 : x 1, y 1, z 1 V 2 : x 2, y 2, z 2 V 3 : x 3, y 3, z 3 V 4 : x 4, y 4, z 4 V 5 : x 5, y 5, z 5 EDGE TABLE E 1 : V 1, V 2 E 2 : V 2, V 3 E 3 : V 3, V 1 E 4 : V 3, V 4 E 5 : V 4, V 5 E 6 : V 5, V 1 POLYGON TABLE P 1 : V 1, V 2, V 3 P 2 : V 1, V 3, V 4, V 5 POLYGON TABLE P 1 : E 1, E 2, E 3 P 2 : E 3, E 4, E 5, E 6 or E1E1 E2E2 E3E3 E5E5 E4E4 E6E6 V2V2 V3V3 V4V4 V5V5 V1V1 P1P1 P2P2

5 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics The geometry can be stored as three tables: a vertex table, an edge table, and a polygon table. Each entry in the vertex table is a list of coordinates defining that point. Each entry in the edge table consists of a pointer to each endpoint of that edge. And the entries in the polygon table define a polygon by providing pointers to the edges that make up the polygon. We can eliminate the edge table by letting the polygon table reference the vertices directly, but we can run into problems, such as drawing some edges twice, because we don't realise that we have visited the same set of points before, in a different polygon. We could go even further and eliminate the vertex table by listing all the coordinates explicitly in the polygon table, but this wastes space because the same points appear in the polygon table several times. Polygon Meshes

6 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Representing Polygon Meshes 1).The explicit way: just list 3D vertices of each polygon in a certain order. The problems are, firstly it represents same vertex many times and secondly, no explicit representation of shared edges and vertices 2).Pointer to a vertex list: store all vertices once into a numbered list, and represent each polygon by its vertices. It saves space (vertex only listed once) but still has no explicit representation of shared edges and vertices 3).Explicit edges: list all edges that belong to a polygon, and for each edge list the vertices that define it along with the polygons of which it is a member.

7 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Types of Curves 1).Explicit: In the Cartesian plane, an explicit equation of a planar curve is given by y = f(x). The difficulties with this approach are that (1) it is impossible to get multiple values of y for a single x, so curves such as circles and ellipses must be represented by multiple curve segments; and (2) describing curves with vertical tangents is difficult and numerically unstable. 2).Implicit: f(x, y) = 0Ax+By+C =0 This method has difficulties on determining tangent continuity of two given curves which is crucial in many applications. (Circle can be defined as: x 2 +y 2 =1, but what about a half circle?)

8 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Types of Curves 3).Parametric Curves: The cubic polynomials that defines a curve segment Q(t)= [x(t) y(t)] T are of the form Written in matrix form, it becomes Q(t)= [x(t) y(t)] = T  C where

9 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Parametric Bicubic Surfaces The equations that describe a parametric curve depend on a variable t that is not explicitly part of the geometry. By sweeping through t, in our case 0 ≤ t ≤ 1, it is possible to evaluate the equations and determine the x and y values for points on the curve. t = 0.0 t = 1.0 t Parameter spaceObject space

10 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Parametric Bicubic Surfaces Parametric Bicubic Surfaces are a generalisation of parametric cubic curves If one parameter, say v, is held at a constant value then the above will represent a curve. The surface is then generated by sweeping all points on the boundary curve P(u,0) (say) through cubic trajectories, defined using the parameter v, to the boundary curve P(u,1). v=0 u=0 u=1 v=1

11 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics The representation of the bicubic surface patch can be illustrated by considering the Bézier Surface Patch. The edge P(0,v) of a Bezier patch is defined by giving four control points P 00, P 01, P 02 and P 03. Similarly the opposite edge P(1,v) can be represented by a Bezier curve with four control points. The surface patch is generated by sweeping the curve P(0,v) through a cubic trajectory in the parameter u to P(1,v). To define this trajectory we need four control points, hence the Bezier surface patch requires a mesh of 4  4 control points as illustrated below. Bézier Surface Patch

12 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Further reading… Chapter 11 of Foley and VanDam  Representing Curves and Surfaces

13 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Surfaces – a Simple Extension Easy to generalise from cubic curves to bicubic surfaces. Surfaces defined by parametric equations of two variables, s and t. ie. a surface is approximated by a series of crossing parametric cubic curves Result is a polygon mesh and decreasing step size in s and t will give a mesh of small near-planar quadrilateral patches and more accuracy. © 2007 Hawick, K. Massey University (New Zealand) 159.235 Graphics and Graphical Programming

14 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Example Bézier surface

15 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Control of Surface Shape Control is now a 2D array of control points. The two parameter surface function, forming the tensor product with the blending functions is: Use appropriate blending functions for Bézier and B-Spline surface functions. Convex Hull property is preserved since bicubic is still a weighted sum (1).

16 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Bézier Example Matrix formulation is as follows: Substitute suitable values for s and t (20 in the above ex.)

17 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics B-Spline Surfaces Break surface into 4-sided patches choosing suitable values for s and t. Points on any external edges must be multiple knots of multiplicity k. Lot more work than Bézier. There are other types of spline systems and NURBS modelling packages are available to make the work much easier. Use polygon packages for display, hidden-surface removal and rendering. (Bézier too)

18 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Continuity of Bicubic Patches Hermite and Bézier patches  C 0 continuity by sharing 4 control points between patches.  C 1 continuity when both sets of control points either side of the edge are collinear with the edge. B-Spline patch.  C 2 continuity between patches.

19 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Displaying Bicubic Patches Can calculate surface normals to bicubic surfaces by vector cross product of the 2 tangent vectors. Normal is expensive to compute  Formulation of normal is a biquintic (two-variable,fifth-degree) polynomial. Display.  Can use brute-force method – very expensive !  Forward differencing method very attractive.

20 Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Curves & Surfaces II - Summary Bezier Curves Bicubic patches Acknowledgments - thanks to Eric McKenzie, Edinburgh, from whose Graphics Course some of these slides were adapted.


Download ppt "Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 32 of 42 Wednesday, 11."

Similar presentations


Ads by Google