SI23 Introduction to Computer Graphics

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
MULTIPLYING MONOMIALS TIMES POLYNOMIALS (DISTRIBUTIVE PROPERTY)
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
7.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 7 Introducing SVG Transformations on Elements.
9.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 9 – Clipping.
Visualization Techniques -
SI23 Introduction to Computer Graphics
SI23 Introduction to Computer Graphics
ZMQS ZMQS
Bézier Curves: Integrating Math, Arts and Technology Jomar F. Rabajante UPLB.
Energy & Green Urbanism Markku Lappalainen Aalto University.
Lecture 14 Curves and Surfaces II
Past Tense Probe. Past Tense Probe Past Tense Probe – Practice 1.
Splines IV – B-spline Curves
Splines I – Curves and Properties
Addition 1’s to 20.
25 seconds left…...
Copyright © Cengage Learning. All rights reserved.
Test B, 100 Subtraction Facts
Week 1.
Copyright © Cengage Learning. All rights reserved.
Curves Jim Van Verth Essential Math for Games Animation Problem: want to replay stored set of transformations  Generated by.
Computer Graphics (Spring 2008) COMS 4160, Lecture 6: Curves 1
Lecture 10 Curves and Surfaces I
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
Slide 127 October 1999CS Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to in Hearn & Baker Splines can be 2D.
AN INTRODUCTION BEZIER CURVES. AN INTRODUCTION BEZIER CURVES Bezier was an engineer with the Renault car company and set out in the early 1960's to develop.
Splines II – Interpolating Curves
09/04/02 Dinesh Manocha, COMP258 Bezier Curves Interpolating curve Polynomial or rational parametrization using Bernstein basis functions Use of control.
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Bezier and Spline Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Computer Graphics 12: Spline Representations
Modelling: Curves Week 11, Wed Mar 23
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Splines III – Bézier Curves
Curve Modeling Bézier Curves
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves.
V. Space Curves Types of curves Explicit Implicit Parametric.
Introduction to Computer Graphics with WebGL
Spline Representations
1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 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.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
Computer Graphics (Fall 2003) COMS 4160, Lecture 10: Curves 1 Ravi Ramamoorthi
Slide 129 October 1999CS Computer Graphics (Top Changwatchai) Bézier Curves - Results of Derivation Tangents at endpoints are equal to endpoint slopes.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 12: Curves 1
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
Introduction to Parametric Curve and Surface Modeling.
CSE 167 [Win 17], Lecture 9: Curves 1 Ravi Ramamoorthi
© University of Wisconsin, CS559 Spring 2004
Chapter 5 Curves and Fractals.
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.
Parametric Line equations
UNIT-5 Curves and Surfaces.
Introduction to Parametric Curve and Surface Modeling
Spline representation. ❖ A spline is a flexible strip used to produce a smooth curve through a designated set of points. ❖ Mathematically describe such.
Type to enter a caption. Computer Graphics Week 10 Lecture 2.
Presentation transcript:

SI23 Introduction to Computer Graphics Lecture 8 – Grouping Elements Drawing Curves

Sequences of Transformations in SVG In lecture 7, we saw that scaling and rotation are applied with respect to origin To scale about a specified point: Translate point to origin Scale Translate back In SVG we can apply a list of transformations: transform=“translate(10,10) scale(2,3) translate(-10,-10)” Note: applied right to left

Grouping Elements in SVG Elements can be formed into groups Allows operations such as transformations to be applied to the whole group <g transform=“translate(50,50)”> <circle cx=“100” cy=“50”/> <circle cx=“200” cy=“250”/> </g>

SVG Symbols Elements can be formed into special groups called symbols in a setup section marked by the defs element ..and later instanced as a graphics object through the use element <defs> <g id=“twoCircles”> <circle cx=“10” cy=“10”/> <circle cx=“20” cy=“20”/> </g> </defs> <use id=“yellowTwoCircles” xlink:href=“#TwoCircles” style=“fill:yellow;”/> <use id=“redTwoCircles” xlink:href=“#TwoCircles” style=“fill:red;”/>

Drawing Curves Many graphical objects involve curves, not straight lines How do we draw them? Airfoil design

Parametric equation of straight line Consider a straight line between P0 (x0,y0) and P1 (x1,y1) P0 P1 x(t) = (1-t) x0 + t x1 y(t) = (1-t) y0 + t y1 t runs from 0 to 1 P(t) = (1-t) P0 + t P1 known as parametric equation of straight line

Basis Functions P(t) = (1-t) P0 + t P1 P0 P1 Another way of viewing this is to think that the functions `t’ and `1-t’ blend the points P0 and P1 together. The functions `t’ and `1-t’ are known as basis functions

Curve Design Suppose we want to design a curve between P0 and P1 P1 P0 Pierre Bezier, a French engineer with Renault, developed a useful way of designing curves, based on an approximating polygon.

Pierre Bezier

Bernstein Polynomials The functions `t’ and `1-t’ are special cases of more general polynomial functions called Bernstein polynomials Degree 2 Bernstein polynomials are: (1-t)2 2t(1-t) t2 These act as basis functions to let us blend three points by: P(t) = (1-t)2P0 + 2t(1-t)P1 + t2P2 P2 Quadratic Bezier curve P1 acts as a control point P0 P1 P0

Bezier Curves and Bernstein Polynomials The general form for the (n+1) Bernstein polynomials of degree n is: B(n,k) = C(n,k)tk(1-t)n-k where C(n,k) = n! / [ k! (n-k)!] and where k runs from 0 to n The Bezier curve is: P(t) = S Pk B(n,k) ... summed from 0 to n, where Pk are (n+1) control points

Cubic Bezier Curves Probably the most popular is the cubic Bezier curve Two end points and two control points P(t) = (1-t)3P0 + 3t(1-t)2P1 + 3t2(1-t)P2 + t3P3

Cubic Bezier Curves A wide variety of shapes can be achieved

Properties of Bezier Curves Curve passes through first and last control points Slope of curve at first control point is along line towards second control point Slope at last control point is along line towards last but one control point Curve lies within the convex hull of the control points

Designing Using Bezier Curves First pick a certain number of points through which the curve should pass

Designing Using Bezier Curves Design curve pieces - probably using cubic Bezier curves

Designing Using Bezier Curves Pieces will join smoothly if control points in adjacent pieces lie on straight line

Paths in SVG Path element in SVG defines a shape that can be open… or closed <path d=“M 0,0 L 50,60 L 100,100”/> <path d=“M 0,0 L 50,60 L100,100 Z”/> Note what M, L and Z mean

Curved Paths in SVG Paths can be defined as quadratic or cubic Bezier curves <path d="M 50,150 C 25,100 275,100 250,200" /> Note the meaning of C and the order of the co-ordinates