1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.

Slides:



Advertisements
Similar presentations
Computer Graphics - Geometry & Representation -
Advertisements

Transformations Ed Angel Professor Emeritus of Computer Science
Vector Calculus Mengxia Zhu Fall Objective Review vector arithmetic Distinguish points and vectors Relate geometric concepts to their algebraic.
Demetriou/Loizidou – ACSC330 – Chapter 4 Geometric Objects and Transformations Dr. Giorgos A. Demetriou Dr. Stephania Loizidou Himona Computer Science.
UBI 516 Advanced Computer Graphics
Math Foundations of CG Math 1 Hofstra University.
2/7/2001Hofstra University – CSC290B1 Review: Math (Ch 4)
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and.
Math Foundations of CG Math 1 Hofstra University.
Math Foundations of CG Math 1 Hofstra University.
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
3D Geometry for Computer Graphics
Vectors.
Scalar and Vector Fields
Section 9.2 Vectors Goals Goals Introduce vectors. Introduce vectors. Begin to discuss operations with vectors and vector components. Begin to discuss.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Computer Graphics Lecture 10 Fasih ur Rehman. Last Class Viewing – Perspectives – Projections.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Math Primer for CG Ref: Interactive Computer Graphics, Chap. 4, E. Angel.
Kansas State University Department of Computing and Information Sciences CIS 736: Computer Graphics Monday, 26 January 2004 William H. Hsu Department of.
Geometry CSC 2141 Introduction to Computer Graphics.
1 Geometry. 2 Objectives Introduce the elements of geometry ­Scalars ­Vectors ­Points Develop mathematical operations among them in a coordinate-free.
Kansas State University Department of Computing and Information Sciences CIS 736: Computer Graphics Wednesday, January 19, 2000 William H. Hsu Department.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Chapter 4 Geometric Objects and Transformation.
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Angel: Interactive.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Geometric Objects and Transformation
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
VECTORS (Ch. 12) Vectors in the plane Definition: A vector v in the Cartesian plane is an ordered pair of real numbers:  a,b . We write v =  a,b  and.
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Basic Theory (for curve 01). 1.1 Points and Vectors  Real life methods for constructing curves and surfaces often start with points and vectors, which.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics I, Fall 2010 Geometry.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Mathematical Foundation for Graphics
Graphics Graphics Korea University kucg.korea.ac.kr Geometric Primitives 고려대학교 컴퓨터 그래픽스 연구실.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Introduction; Mathematical Foundations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CA 302 Computer Graphics and Visual Programming
CS5500 Computer Graphics March 6, 2006.
Spaces.
Mathematics for Computer Graphics
2 Vectors In 2-space And 3-space
CSC461: Lecture 12 Geometry Objectives
Lecture 03: Linear Algebra
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
Introduction to Computer Graphics with WebGL
2 Vectors in 2-space and 3-space
PPT&Programs
6.3 Vectors in the Plane Ref. p. 424.
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Presentation transcript:

1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science Laboratory University of New Mexico Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

2 Geometry Ed Angel Professor Emeritus of Computer Science University of New Mexico Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

3 Objectives Introduce the elements of geometry ­Scalars ­Vectors ­Points Develop mathematical operations among them in a coordinate-free manner Define basic primitives ­Line segments ­Polygons Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

4 Basic Elements Geometry is the study of the relationships among objects in an n-dimensional space ­In computer graphics, we are interested in objects that exist in three dimensions Want a minimum set of primitives from which we can build more sophisticated objects We will need three basic elements ­Scalars ­Vectors ­Points Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

5 Coordinate-Free Geometry When we learned simple geometry, most of us started with a Cartesian approach ­Points were at locations in space p=(x,y,z) ­We derived results by algebraic manipulations involving these coordinates This approach was nonphysical ­Physically, points exist regardless of the location of an arbitrary coordinate system ­Most geometric results are independent of the coordinate system ­Example Euclidean geometry: two triangles are identical if two corresponding sides and the angle between them are identical Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

6 Scalars Need three basic elements in geometry ­Scalars, Vectors, Points Scalars can be defined as members of sets which can be combined by two operations (addition and multiplication) obeying some fundamental axioms (associativity, commutivity, inverses) Examples include the real and complex number systems under the ordinary rules with which we are familiar Scalars alone have no geometric properties Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

7 Vectors Physical definition: a vector is a quantity with two attributes ­Direction ­Magnitude Examples include ­Force ­Velocity ­Directed line segments Most important example for graphics Can map to other types v Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

8 Vector Operations Every vector has an inverse ­Same magnitude but points in opposite direction Every vector can be multiplied by a scalar There is a zero vector ­Zero magnitude, undefined orientation The sum of any two vectors is a vector ­Use head-to-tail axiom v -v vv v u w Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

9 Linear Vector Spaces Mathematical system for manipulating vectors Operations ­Scalar-vector multiplication u =  v ­Vector-vector addition: w = u + v Expressions such as v=u+2w-3r Make sense in a vector space Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

10 Vectors Lack Position These vectors are identical ­Same length and magnitude Vectors spaces insufficient for geometry ­Need points Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

11 Points Location in space Operations allowed between points and vectors ­Point-point subtraction yields a vector ­Equivalent to point-vector addition P=v+Q v=P-Q Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

12 Affine Spaces Point + a vector space Operations ­Vector-vector addition ­Scalar-vector multiplication ­Point-vector addition ­Scalar-scalar operations For any point define ­1 P = P ­0 P = 0 (zero vector) Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

13 Lines Consider all points of the form ­P(  )=P 0 +  d ­Set of all points that pass through P 0 in the direction of the vector d Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

14 Parametric Form This form is known as the parametric form of the line ­More robust and general than other forms ­Extends to curves and surfaces Two-dimensional forms ­Explicit: y = mx +h ­Implicit: ax + by +c =0 ­Parametric: x(  ) =  x 0 + (1-  )x 1 y(  ) =  y 0 + (1-  )y 1 Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

15 Rays and Line Segments If  >= 0, then P(  ) is the ray leaving P 0 in the direction d If we use two points to define v, then P(  ) = Q +  (R-Q)=Q+  v =  R + (1-  )Q For 0<=  <=1 we get all the points on the line segment joining R and Q Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

16 Convexity An object is convex iff for any two points in the object all points on the line segment between these points are also in the object P Q Q P convex not convex Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

17 Affine Sums Consider the “sum” P=  1 P 1 +  2 P 2 +…..+  n P n Can show by induction that this sum makes sense iff  1 +  2 +…..  n =1 in which case we have the affine sum of the points P 1  P 2,…..P n If, in addition,  i >=0, we have the convex hull of P 1  P 2,…..P n Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

18 Convex Hull Smallest convex object containing P 1  P 2,…..P n Formed by “shrink wrapping” points Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

19 Curves and Surfaces Curves are one parameter entities of the form P(  ) where the function is nonlinear Surfaces are formed from two-parameter functions P( ,  ) ­Linear functions give planes and polygons P(  ) P( ,  ) Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

20 Planes A plane can be defined by a point and two vectors or by three points P( ,  )=R+  u+  v P( ,  )=R+  (Q-R)+  (P-Q) u v R P R Q Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

21 Triangles convex sum of P and Q convex sum of S(  ) and R for 0<= ,  <=1, we get all points in triangle Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

Barycentric Coordinates Triangle is convex so any point inside can be represented as an affine sum P(  1,  2,  3 )=  1 P+  2 Q+  3 R where  1 +  2 +  3 = 1  i >=0 The representation is called the barycentric coordinate representation of P 22 Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015

23 Normals In three dimensional spaces, every plane has a vector n perpendicular or orthogonal to it called the normal vector From the two-point vector form P( ,  )=P+  u+  v, we know we can use the cross product to find n = u  v and the equivalent form (P(  )-P)  n=0 u v P Angel and Shreiner: Interactive Computer Graphics 7E © Addison-Wesley 2015