Vector Tools for Computer Graphics

Slides:



Advertisements
Similar presentations
Computer Graphics - Geometry & Representation -
Advertisements

10.2 Vectors and Vector Value Functions
6.3 Vectors in the Plane Many quantities in geometry and physics, such as area, time, and temperature, can be represented by a single real number. Other.
Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.
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.
General Physics (PHYS101)

1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
CS 4731: Computer Graphics Lecture 6: Points, Scalars and Vectors Emmanuel Agu.
University of North Carolina at Greensboro
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and.
3D Geometry for Computer Graphics Class 1. General Office hour: Sunday 11:00 – 12:00 in Schreiber 002 (contact in advance) Webpage with the slides:
Computer Graphics Recitation 1. General Office hour: Sunday 16:00 – 17:00 in Schreiber 002 Webpage with the slides:
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter Vector Tools for Graphics.
1 Computer Graphics Chapter 5 Vector Based Algorithms.
Vectors.
Fall Scalar Quantity (mass, speed, voltage, current and power) 1- Real number (one variable) 2- Complex number (two variables) Vector Algebra (velocity,
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Vectors Tools for Graphics.  To review vector arithmetic, and to relate vectors to objects of interest in graphics.  To relate geometric concepts to.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
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.
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.
1.1 – 1.2 The Geometry and Algebra of Vectors.  Quantities that have magnitude but not direction are called scalars. Ex: Area, volume, temperature, time,
Section 13.4 The Cross Product. Torque Torque is a measure of how much a force acting on an object causes that object to rotate –The object rotates around.
2003CS Hons RW778 Graphics1 Chapter 3: Windows, viewports World coordinates rather than screen coordinates. World coordinates rather than screen coordinates.
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Section 10.2a VECTORS IN THE PLANE. Vectors in the Plane Some quantities only have magnitude, and are called scalars … Examples? Some quantities have.
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.
Coordinate Systems and Coordinate Frames  vector v = (3, 2, 7)  point P = (5, 3, 1)  coordinate frame consists of a specific point, V, called the origin,
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
DOT PRODUCT CROSS PRODUCT APPLICATIONS
CHAPTER 3: VECTORS NHAA/IMK/UNIMAP.
1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.
Vectors and Dot Product 6.4 JMerrill, Quick Review of Vectors: Definitions Vectors are quantities that are described by direction and magnitude.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part I.
Computer Graphics I, Fall 2010 Geometry.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CSE 681 Brief Review: Vectors. CSE 681 Vectors Basics Normalizing a vector => unit vector Dot product Cross product Reflection vector Parametric form.
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.
Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.
Graphics Graphics Korea University kucg.korea.ac.kr Geometric Primitives 고려대학교 컴퓨터 그래픽스 연구실.
6.4 Vectors and Dot Products Objectives: Students will find the dot product of two vectors and use properties of the dot product. Students will find angles.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
CSE 681 Brief Review: Vectors. CSE 681 Vectors Direction in space Normalizing a vector => unit vector Dot product Cross product Parametric form of a line.
Vectors – The Dot Product Lecture 12 Mon, Sep 22, 2003.
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Vector 2.
CA 302 Computer Graphics and Visual Programming
Mathematics for Computer Graphics
2 Vectors In 2-space And 3-space
Outline Addition and subtraction of vectors Vector decomposition
Contents 7.1 Vectors in 2-Space 7.2 Vectors in 3-Space 7.3 Dot Product
CSC461: Lecture 12 Geometry Objectives
Lecture 03: Linear Algebra
Vectors, Linear Combinations and Linear Independence
Introduction to Computer Graphics with WebGL
2 Vectors in 2-space and 3-space
PPT&Programs
Vectors and Dot Products
Rayat Shikshan Sanstha’s S.M.Joshi College, Hadapsar -28
6.3 Vectors in the Plane Ref. p. 424.
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Presentation transcript:

Vector Tools for Computer Graphics

Vector Tools for Computer Graphics Two branches of Mathematics Vector Analysis Transformation Why Vectors?

Basic Definitions Points specify location in space (or in the plane). Vectors have magnitude and direction (like velocity). Points  Vectors

Basics of Vectors v Vector as displacement: v is a vector from point P to point Q. P v Q The difference between two points is a vector: v = Q - P Another way: The sum of a point and a vector is a point : P + v = Q v Q P

Multiplication be scalars Operations on Vectors Two operations Addition a + b a = (3,5,8), b = (-1,2,-4) a + b = (2,7,4) Multiplication be scalars sa a = (3,-5,8), s = 5 5a = (15,-25,40) operations are done componentwise

Multiplication by scalar Operations on vectors Addition a b a+ b a b a+ b Multiplication by scalar a 2a -a

Operations on vectors Subtraction a c -c a-c

Linear Combination of Vectors Definition Linear combination of m vectors v1, v2, …, vm: w = a1v1 + a2 v2 + …+ amvm where a1,a2,…am are scalars. Types Affine Combination a1 + a2 + …+ am = 1 Examples: 3a + 2b - 4c (1- t)a + (t)b Convex Combination a1 + a2 + …+ am = 1 and ai ≥ 0, for i = 1,…m. Example: .3a + .2b + .5c

Convex Combination of Vectors a(v2-v1) v3 v v1 v2 v1

The standard unit vectors: i = (1,0,0), j = (0,1,0) and k = (0,0,1) Properties of vectors Length or size w = (w1,w2,…,wn) Unit vector The process is called normalizing Used to refer direction The standard unit vectors: i = (1,0,0), j = (0,1,0) and k = (0,0,1)

Dot Product The dot product d of two vectors v = (v1,v2,…,vn) and w = (w1,w2,…wn): Properties Symmetry: a·b = b·a Linearity: (a+c) ·b = a·b + c·b Homogeneity: (sa) ·b = s(a·b) |b|2 = b·b

Application of Dot Product Angle between two vectors: y c b θ Φc Φb x Two vectors b and c are perpendicular (orthogonal/normal) if b·c = 0

is the counterclockwise perpendicular to a. 2D “perp” Vector Which vector is perpendicular to the 2D vector a = (ax,ay)? Let a = (ax,ay). Then a┴ = (-ay,ax) is the counterclockwise perpendicular to a. a┴ -a┴ a a What about 3D case?

Applications: Orthogonal Projection Mv┴ c c L v┴ A Kv v v A

Applications: Reflections m -m e a n r θ1 θ2 r = a - 2 ( a . n) n

Cross Product Also called vector product. Defined for 3D vectors only. Properties Antisymmetry: a Χ b = - b Χ a Linearity: (a +c) Χ b = a Χ b + c Χ b Homogeneity: (sa) Χ b = s(a Χ b)

Geometric Interpretation of Cross Product axb a b x y z P2 P1 P3 aXb is perpendicular to both a and b | aXb | = area of the parallelogram defined by a and b

Representation of Vectors and Points

Coordinate Frame b P v O a c

Homogeneous Representation Basic objects: a,b,c,O Represent points and vectors using these objects

Homogeneous Representation To go from ordinary to homogeneous If point append 1 as the last coordinate. If vector append 0 as the last coordinate. To go from homogeneous to ordinary The last coordinate must be made 1 and then delete it The last coordinate must be made 0 and then delete it

Linear Combinations of vectors The difference of two points is a vector The sum of a point and vector is a point The sum of two vectors is a vector The scaling of a vector is a vector Any linear combination of vectors is a vector

any affine combination of points is a legitimate point Affine Combinations of Points Two points P=(P1,P2,P3,1) and R=(R1,R2,R3,1): E = fP + gR=(fP1+gR1, fP2+gR2, fP3+gR3, f+g) Since affine combination so f+g=1 So, E is a valid point in homogeneous representation NOT a valid point, unless f + g = 1 Example: 0.3P+0.7R is a valid point, but P + R is not. any affine combination of points is a legitimate point

Linear Combinations of Points Linear combination of two points P and R: E = fP + gR If the system is shifter by U P’ = P + U R’ = R + U E’ should be equal to E+U i.e E’=E+U E should also be shifted by U But, E’ = fP’ + gR’ = fP + gR + (f+g)U NOT, unless f + g = 1

Affine Combinations of Points [contd] P1+P2 P2 P1 P1+P2 (P1+P2)/2

Point + Vector = Affine Comb of Points Let, P = A + t v and v = B – A Therefore, P = A + t (B – A) => P = t B + (1 – t) A. “Tweening” See Hill 4.5.4 Linear Interpolation

Representing Lines 3 types of representations: Ray Line Line segment Two point form Parametric representation Point normal form

Parametric Representation of a Line y t > 1 B b t = 1 C t = 0 t < 0 x

Point Normal Form of a Line B R C

All in One : Representations of Line B = C - n┴ Point Normal Two Point {C, n} {C, B} n = (B – C) ┴ b = - n┴ B = C + b n = b┴ b = B – C Parametric {C, b}

Planes in 3D 3 fundamental forms Three-point form Parametric representation Point normal form

Parametric Representation of Plane b

Point Normal Form of a Plane B

All in One : Representations of Plane A=(0,0,n.C/ nz) C=(C-0) B=(0,n.C/ ny,0) Point Normal Three Point {C, n} n = (A-C)x(B – C) {A,C,B} a= (0,0,1)xn A = C + a B = C + b b = nxa n = axb Parametric a= A – C b = B – C {C, a, b}

Readings Hill 4.1 – 4.6