We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byTessa Lover
Modified about 1 year ago
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/15 Describing Shapes Constructing Objects in Computer Graphics Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 2/15 Lines and polylines: Polylines: lines drawn between ordered points A closed polyline is a polygon, a simple polygon has no self-intersections Convex and concave polygons: Convex: Line between any two points is inside polygon Concave: At least one line between two points crosses outside polygon 2D Object Definition (1/3) simple polygon, closed polyline not closed, simple polyline not simple polygon, closed polyline convex concave Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 3/15 Special Polygons: Circles: Set of all points equidistant from one point called the center The distance from the center is the radius r The equation for a circle centered at (0, 0) is r 2 = x 2 + y 2 2D Object Definition (2/3) Triangle SquareRectangle (0, y) (0, x) r (0, 0) (x, y) Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 4/15 A circle can be approximated by a polygon with many sides. Axis aligned ellipse: a circle scaled in the x and/or y direction 2D Object Definition (3/3) 0 1 1 2 2 3 4 5 6 7 8 9 10 3 4 5 6 0 1 1 2 2 3 4 5 6 7 8 9 3 4 5 6 Scaled by a factor of 2 in the x direction and not scaled in the y direction. Width changes from 3.5 to 7. Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 5/15 Vertex and edge tables: General purpose, minimal overhead, reasonably efficient Each vertex listed once Each edge is an ordered pair of indices to the vertex list Sufficient to draw shape and perform simple operations (transforms, point inside/outside) Edges listed in counterclockwise order by convention Representing Shapes Vertices 0(0, 0) 1(2, 0) 2(0, 1) 3(2, 1) 4(1, 1.5) Edges 0(0, 1) 1(1, 3) 2(3, 4) 3(4, 2) 4(2, 0) E4E4 E3E3 E2E2 E0E0 E1E1 V0V0 V1V1 V2V2 V3V3 V4V4 Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 6/15 We can represent any polyline with vertices and edges. What about curves? Don’t want to store curves as raster graphics (aliasing, not scalable, memory intensive). We need a more efficient mathematical representation Store control points in a list, find some way of smoothly interpolating between them Closely related to curve-fitting of data, done by hand with “French curves”, or by computation Piecewise Linear Approximation Not smooth, looks awful without many control points Trigonometric functions Difficult to manipulate and control, computationally expensive Higher order polynomials Relatively cheap to compute, only slightly more difficult to operate on than polylines Splines (1/5) - Representing General Curves Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 7/15 Polynomial interpolation is typically used. Splines are parametric curves governed by control points or control vectors, third or higher order Used early on in automobile and aircraft industry to achieve smoothness – even small differences can make a big difference in efficiency and look. Used for: Representing smooth shapes in 2D as outlines or in 3D using "patches" parameterized with two variables: s and t (see slide 13) Animation paths for "tweening" between keyframes Approximating "expensive" functions (polynomials are cheaper than log, sin, cos, etc.) Splines (2/5) – Spline Types and Uses Splines still exist outside of computers. They’re now called flexible curves. V0V0 V1V1 V2V2 V3V3 V4V4 V5V5 approximating spline interpolating spline polyline approximation Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 8/15 Polylines are linear (1 st order polynomial) interpolations between points Given points P and Q, line between the two is given by the parametric equation: and t are called weighting functions of P and Q Splines are higher order polynomial interpolations between points Like linear interpolation, but with higher order weighting functions allowing better approximations/smoother curves One representation - Hermite curves (Interpolating spline): Determined by two control points P and Q, an initial tangent vector v and a final tangent vector w. Satisfies: Splines (3/5) – Hermite Curves w v Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 9/15 Splines (4/5) – Hermite Weighting Explained Polynomial weighting functions in Hermite curve equation 1 (0, 0) 1 Polynomial splines have more complex weighting functions than lines Coefficients for P and Q are now 3 rd degree polynomials At t = 0 Coefficients of P is 1, all others 0 Derivative of coefficient of v is 1, derivative of all others is 0 At t = 1 Coefficient of Q is 1, all others 0 Derivative of coefficient of w is 1, derivative of all others 0 Can be chained together to make more complex curves Representing Shape – 9/16/14 P’s Coefficient Q’s Coefficient v’s coefficient w’s coefficient
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 10/15 Splines (5/5) – Bezier Curves Image credit: http://miphol.com/muse/2008/04/25/Bezier-courbes-anim.gif www.cs.brown.edu/exploratories/freeSoftware/repository/edu/brown/cs/exploratories/applets/bezierSplines/bezier_splines_guide.html Representing Shape – 9/16/14 Bezier representation is similar to Hermite 4 points instead of 2 points and 2 vectors Initial position P 1, tangent vector is Final position P 4, tangent vector is This representation allows a spline to be stored as a list of vertices with some global parameters that describe the smoothness and continuity Bezier splines are widely used (Adobe, Microsoft) for font definition See chapters 23 and 24 for more on splines
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 11/15 A line is drawn by tracing a point as it moves (1 st dimension added) A rectangle is drawn by tracing the vertices of a line as it moves perpendicularly to itself (2 nd dimension added) A rectangular prism is drawn by tracing the vertices of a rectangle as it moves perpendicularly to itself (3 rd dimension) A circle is drawn by tracing a point swinging at a fixed distance around a center point. “Vertices in Motion” - Object Definition Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 12/15 Made out of 2D and 1D primitives Triangles are commonly used Many triangles used for a single object is a triangular mesh Splines used to describe boundaries of "patches" – these can be "sewn together" to represent curved surfaces Building 3D Primitives Image credit (Stanford Bunny): http://mech.fsv.cvut.cz/~dr/papers/Habil/img1007.gif Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 13/15 Most common representation of shape in three dimensions All vertices of triangle are guaranteed to lie in one plane (not true for quadrilaterals or other polygons) Uniformity makes it easy to perform mesh operations such as subdivision, simplification, transformation etc. Many different ways to represent triangular meshes See chapters 8 and 25 in book, en.wikipedia.org/wiki/polygon_mesh en.wikipedia.org/wiki/polygon_mesh Mesh transformation and deformation Procedural generation techniques (upcoming labs on simulating terrain) Triangle Meshes Image credit: http://upload.wikimedia.org/wikipedia/commons/f/fb/Dolphin_triangle_mesh.png Representing Shape – 9/16/14
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 14/15 Vertex and face tables, analogous to 2D vertex and edge tables Each vertex listed once, triangles listed as ordered triplets of indices into the vertex table Edges inferred from triangles It’s often useful to store associated faces with vertices (i.e. computing normals: vertex normal average of surrounding face normals) Vertices listed in counter clockwise order in face table. No longer just because of convention. CCW order differentiates front and back of face Triangular Mesh Representation Diagram licensed under Creative Commons Attribution license. Created by Ben Herila based on http://upload.wikimedia.org/wikipedia/en/thumb/2/2d/Mesh_fv.jpg/500px-Mesh_fv.jpg http://upload.wikimedia.org/wikipedia/en/thumb/2/2d/Mesh_fv.jpg/500px-Mesh_fv.jpg v0 v1v2 f3 f2 f1 f0 f9 v4 v7 v6 f10 f8 f11 v5 Vertex List v0 0, 0, 0 f0 f1 f12 f15 f7 v1 1, 0, 0 f2 f3 f13 f12 f1 v2 1, 1, 0 f4 f5 f14 f13 f3 v3 0, 1, 0 f6 f7 f15 f14 f5 v4 0, 0, 1 f6 f7 f0 f8 f11 v5 1, 0, 1 f0 f1 f2 f9 f8 v6 1, 1, 1 f2 f3 f4 f10 f9 v7 0, 1, 1 f4 f5 f6 f11 f10 v8.5,.5, 1 f8 f9 f10 f11 v9.5,.5, 0 f12 f13 f14 f15 Face List f0v0 v5 v4 f1v0 v5 v1 f2v1 v6 v5 f3v1 v2 v6 f4v2 v7 v6 f5v2 v3 v7 f6v3 v4 v7 f7v3 v0 v4 f8v8 v4 v5 f9v8 v5 v6 f10v8 v6 v7 f11v8 v7 v4 f12v9 v1 v0 f13v9 v2 v1 f14v9 v3 v2 f15v9 v0 v3 Representing Shape – 9/16/14 v8
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 15/15 Chapter 8 Chapters 22 and 23 for splines (warning: pretty heavy math) Chapter 24 for implicit shapes Chapter 25 for meshes Representing Shape – 9/16/14 Book Sections
C O M P U T E R G R A P H I C S Stuff Jian Chen January 15, 2010 Transformations 1/10 Describing Shape By Andries van Dam.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
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.
+ CPCS 391 Computer Graphics 1 Lecture 5: Polygon Filling Instructor: Dr. Sahar Shabanah.
In the name of God Computer Graphics Bastanfard. Curve Function(2) Other method is approximate it using a poly-line. Just locate a set of points along.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
Modelling. Outline Modelling methods Editing models – adding detail Polygonal models Representing curves Patched surfaces.
CS 376 Introduction to Computer Graphics 04 / 20 / 2007 Instructor: Michael Eckmann.
CS 325 Computer Graphics 04 / 30 / 2010 Instructor: Michael Eckmann.
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 8 Engineering Geometry.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
June D Object Representation Shmuel Wimer Bar Ilan Univ., School of Engineering.
CS 450: COMPUTER GRAPHICS PARAMETRIC SPLINES AND SURFACES SPRING 2015 DR. MICHAEL J. REALE.
1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided.
Splines I – Curves and Properties based on: Michael Gleicher Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
Curve Modeling Dr. S.M. Malaek Assistant: M. Younesi.
Geometric Modeling Surfaces Mortenson Chapter 6 and Angel Chapter 9.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
Splines III – Bézier Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
I NTRODUCTION TO C URVES UNIT V. I NTRODUCTION Objects in the real world may not always be made up of regular geometric shapes. Surfaces are made up of.
2002 by Jim X. Chen: Bezier Curve Bezier Curve.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
Curve Modeling Bézier Curves Dr. S.M. Malaek Assistant: M. Younesi.
ENDS 375 Foundations of Visualization Geometric Representation 9/30/04.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
CS 450: COMPUTER GRAPHICS REVIEW: OVERVIEW OF POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
2003 by Jim X. Chen: Introduction to Modeling Jim X. Chen George Mason University.
CSCI480/582 Lecture 9 Chap.2.2 Cubic Splines – Hermit and Bezier Feb, 11, 2009.
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
Intermediate Math Parametric Equations Local Coordinate Systems Curvature Splines.
Curves Jim Van Verth Essential Math for Games Animation Problem: want to replay stored set of transformations Generated by.
5-1 V. Space Curves Types of curves Explicit Implicit Parametric.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 32 of 42 Wednesday, 11.
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.
ENDS 375 Foundations of Visualization Geometric Representation 10/5/04.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
CS 450: COMPUTER GRAPHICS DRAWING ELLIPSES AND OTHER CURVES SPRING 2015 DR. MICHAEL J. REALE.
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Introduction to Parametric Curve and Surface Modeling.
Informationsteknologi Tuesday, December 4, 2007Computer Graphics - Class 141 Today’s class Parametric form curves planes Polygonal meshes Newell’s.
Jack Pinches INFO410 & INFO350 S INFORMATION SCIENCE Geometric Modelling 2.
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
© 2017 SlidePlayer.com Inc. All rights reserved.