CS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15

Similar documents
CS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

3D Modeling Parametric Curves & Surfaces

Introduction to Computer Graphics

Lecture IV Bézier Curves

ECE 600, Dr. Farag, Summer 09

CS354 Computer Graphics Surface Representation IV. Qixing Huang March 7th 2018

Central issues in modelling

2D Object Definition (1/3)

Intro to Modeling Modeling in 3D

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

Curves and Surfaces. Shireen Elhabian and Aly A. Farag University of Louisville

Curves and Surfaces. CS475 / 675, Fall Siddhartha Chaudhuri

Spring 2012 Final. CS184 - Foundations of Computer Graphics. University of California at Berkeley

Physically-Based Modeling and Animation. University of Missouri at Columbia

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Dgp _ lecture 2. Curves

From curves to surfaces. Parametric surfaces and solid modeling. Extrusions. Surfaces of revolution. So far have discussed spline curves in 2D

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

Curves and Surfaces 1

2D Spline Curves. CS 4620 Lecture 18

Computer Graphics Curves and Surfaces. Matthias Teschner

CSCI 4620/8626. Coordinate Reference Frames

CS 4620 Final Exam. (a) Is a circle C 0 continuous?

Curves and Curved Surfaces. Adapted by FFL from CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006

Mathematical Tools in Computer Graphics with C# Implementations Table of Contents

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

Graphics and Interaction Rendering pipeline & object modelling

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Curves. Computer Graphics CSE 167 Lecture 11

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Surface Modeling. Polygon Tables. Types: Generating models: Polygon Surfaces. Polygon surfaces Curved surfaces Volumes. Interactive Procedural

INF3320 Computer Graphics and Discrete Geometry

Curves D.A. Forsyth, with slides from John Hart

Design considerations

Computer Graphics Fundamentals. Jon Macey

GEOMETRIC TOOLS FOR COMPUTER GRAPHICS

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

Curves and Surfaces Computer Graphics I Lecture 10

Einführung in Visual Computing

Know it. Control points. B Spline surfaces. Implicit surfaces

Computer Graphics. The Two-Dimensional Viewing. Somsak Walairacht, Computer Engineering, KMITL

Computergrafik. Matthias Zwicker. Herbst 2010

Information Coding / Computer Graphics, ISY, LiTH. Splines

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

Curves and Surfaces Computer Graphics I Lecture 9

Grade 6 Mathematics Item Specifications Florida Standards Assessments

Computer graphics 2 Marks 1. Define Computer graphics.

Practical Linear Algebra: A Geometry Toolbox

9. Three Dimensional Object Representations

For each question, indicate whether the statement is true or false by circling T or F, respectively.

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

A Comprehensive Introduction to SolidWorks 2011

CHAPTER 1 Graphics Systems and Models 3

Images from 3D Creative Magazine. 3D Modelling Systems

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

Mrs. Daniel s Geometry Vocab List

CGT 581 G Geometric Modeling Surfaces (part I)

Image Segmentation II Advanced Approaches

Sung-Eui Yoon ( 윤성의 )

Rendering Curves and Surfaces. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

CS452/552; EE465/505. Clipping & Scan Conversion

03 Vector Graphics. Multimedia Systems. 2D and 3D Graphics, Transformations

Introduction to Geometry. Computer Graphics CMU /15-662

2D Spline Curves. CS 4620 Lecture 13

Roadmap for tonight. What are Bezier curves (mathematically)? Programming Bezier curves (very high level view).

Computer Graphics I Lecture 11

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

An introduction to interpolation and splines

Parameterization of triangular meshes

pine cone Ratio = 13:8 or 8:5

Curve and Surface Basics

CSE 167: Introduction to Computer Graphics Lecture #11: Bezier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Answer Key: Three-Dimensional Cross Sections

Parameterization. Michael S. Floater. November 10, 2011

9.1 Parametric Curves

Computer Graphics 1. Chapter 2 (May 19th, 2011, 2-4pm): 3D Modeling. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2011

Chapter 4-3D Modeling

MATH 1020 WORKSHEET 10.1 Parametric Equations

Intro to Curves Week 1, Lecture 2

Computational Geometry. Geometry Cross Product Convex Hull Problem Sweep Line Algorithm

Computer Graphics / Animation

Intro to Curves Week 4, Lecture 7

GL9: Engineering Communications. GL9: CAD techniques. Curves Surfaces Solids Techniques

Spline Notes. Marc Olano University of Maryland, Baltimore County. February 20, 2004

CS 4620 Midterm, March 21, 2017

CS 536 Computer Graphics Intro to Curves Week 1, Lecture 2

Generating Vectors Overview

First of all, we need to know what it means for a parameterize curve to be differentiable. FACT:

Lesson 1: Creating T- Spline Forms. In Samples section of your Data Panel, browse to: Fusion 101 Training > 03 Sculpt > 03_Sculpting_Introduction.

CS130 : Computer Graphics Curves. Tamar Shinar Computer Science & Engineering UC Riverside

Generalized barycentric coordinates

CS602 MCQ,s for midterm paper with reference solved by Shahid

ASSIGNMENT 1 INTRODUCTION TO CAD

(Spline, Bezier, B-Spline)

COMP3421. Global Lighting Part 2: Radiosity

Tangent & normal vectors The arc-length parameterization of a 2D curve The curvature of a 2D curve

Transcription:

Describing Shapes Constructing Objects in Computer Graphics 1/15

2D Object Definition (1/3) Lines and polylines: Polylines: lines drawn between ordered points A closed polyline is a polygon, a simple polygon has no self-intersections not closed, simple polyline simple polygon and closed polyline Convex and concave polygons: Convex: Line between any two points is inside polygon Concave: At least one line between two points crosses outside polygon not simple polygon, closed polyline convex concave 2/15

2D Object Definition (2/3) Special Polygons: Triangle Square Rectangle 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 (0, y) (0, 0) r (x, 0) (x, y) 3/15

2D Object Definition (3/3) A circle can be approximated by a polygon with many sides. Axis aligned ellipse: a circle scaled in the x and/or y direction 6 5 4 3 2 1 6 5 4 3 2 1 0 0 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 Scaled by a factor of 2 in the x direction and not scaled in the y direction. Width changes from 3.5 to 7. 4/15

Representing Shapes 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 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) Sufficient to draw shape and perform simple operations (transforms, point inside/outside) Edges listed in counterclockwise winding order for consistency with 3D where we need to compute outward-facing normals E 4 E 3 E 2 V 4 V 2 V 3 E 1 E 0 V 0 V 1 5/15

Splines (1/5) - Representing General Curves 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 6/15

Splines (2/5) Spline Types and Uses 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: V 0 approximating spline V 1 V 2 V 3 polyline approximation Splines still exist outside of computers. They re now called flexible curves. 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.) V 4 interpolating spline V 5 7/15

Splines (3/5) Hermite Curves 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: x t = 1 t P + tq, 0 t 1 and t are called weighting functions of P and Q Splines are higher order polynomial interpolations between points 1 t 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: γ 0 = P γ 1 = Q γ 0 = v γ 1 = w γ t = 2t 3 3t 2 + 1 P + 2t 3 + 3t 2 Q + t 3 2t 2 + t v + t 3 t 2 w P: t = 0 γ v w Q: t = 1 8/15

CS337 INTRODUCTION TO COMPUTER GRAPHICS Splines (4/5) Hermite Weighting Explained Polynomial splines have more complex weighting functions than lines At t = 0 Coefficients for P and Q are now 3 rd degree polynomials 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 Polynomial weighting functions in Hermite curve equation 9/15 1 v s coefficient P s Coefficient Q s Coefficient w s coefficient (0, 0) 1 t

Splines (5/5) Bezier Curves Bezier representation is similar to Hermite 4 points instead of 2 points and 2 vectors Initial position P 1, tangent vector is P 2 P 1 Final position P 4, tangent vector is P 4 P 3 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 https://www.jasondavies.com/animated-bezier/ (P 1 P 4 ) Image credit: http://miphol.com/muse/2008/04/25/bezier-courbes-anim.gif 10/15

Vertices in Motion - Object Definition 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. 11/15

Building 3D Primitives 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 x s, t = 1 s 3 1 t 3 P 1,1 + 1 s 3 3t 1 t 2 P 1,2 + Image credit (Stanford Bunny): http://mech.fsv.cvut.cz/~dr/papers/habil/img1007.gif 12/15

Triangle Meshes 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 Meshes en.wikipedia.org/wiki/polygon_mesh Mesh transformation and deformation Procedural generation techniques (upcoming labs on simulating terrain) Image credit: http://upload.wikimedia.org/wikipedia/commons/f/fb/dolphin_triangle_mesh.png 13/15

Triangular Mesh Representation 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 as 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 v0 v4 f0 f1 f8 v5 v1 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 f11 v8 f9 f2 f10 f3 v7 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 v2 v6 f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 Face List v0 v5 v4 v0 v5 v1 v1 v6 v5 v1 v2 v6 v2 v7 v6 v2 v3 v7 v3 v4 v7 v3 v0 v4 v8 v4 v5 v8 v5 v6 v8 v6 v7 v8 v7 v4 v9 v1 v0 v9 v2 v1 v9 v3 v2 v9 v0 v3 14/15