Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.

Slides:



Advertisements
Similar presentations
Vectors, Points, Lines and Planes Jim Van Verth Lars M. Bishop
Advertisements

Chapter 4 Euclidean Vector Spaces
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
General Physics (PHYS101)
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
CS 450: Computer Graphics OVERVIEW OF POLYGONS
Geometry (Many slides adapted from Octavia Camps and Amitabh Varshney)
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and.
Now Playing: My Mathematical Mind Spoon From Gimme Fiction Released May 10, 2005.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Scalar and Vector Fields
CS 450: Computer Graphics 2D TRANSFORMATIONS
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
CSE554SimplificationSlide 1 CSE 554 Lecture 7: Simplification Fall 2014.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
2IV60 Computer Graphics Basic Math for CG
Vectors and the Geometry of Space
Geometric Intuition Randy Gaul. Vectors, Points and Basis Matrices Rotation Matrices Dot product and how it’s useful Cross product and how it’s useful.
Mathematical Fundamentals
UNIVERSITI MALAYSIA PERLIS
Vectors Tools for Graphics.  To review vector arithmetic, and to relate vectors to objects of interest in graphics.  To relate geometric concepts to.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Chapter 6 ADDITIONAL TOPICS IN TRIGONOMETRY. 6.1 Law of Sines Objectives –Use the Law of Sines to solve oblique triangles –Use the Law of Sines to solve,
Review of Vector Analysis
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.
Chemistry 330 The Mathematics Behind Quantum Mechanics.
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.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
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.
CS 325 Introduction to Computer Graphics 02 / 17 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Geometric Objects and Transformation
CSE554SimplificationSlide 1 CSE 554 Lecture 7: Simplification Fall 2013.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
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.
CGDD 4003 THE MATH LECTURE (BOILED DOWN, YET LIGHTLY SALTED)
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CS 551 / 645: Introductory Computer Graphics Mathematical Foundations.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Geometric Transformations
1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
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.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
1 Teaching Innovation - Entrepreneurial - Global The Centre for Technology enabled Teaching & Learning, N Y S S, India DTEL DTEL (Department for Technology.
CSE 681 Brief Review: Vectors. CSE 681 Vectors Basics Normalizing a vector => unit vector Dot product Cross product Reflection vector Parametric form.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
CA 302 Computer Graphics and Visual Programming
Math Fundamentals Maths revisit.
Outline Addition and subtraction of vectors Vector decomposition
CSC461: Lecture 12 Geometry Objectives
Lecture 03: Linear Algebra
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
CSCE441: Computer Graphics 2D/3D Transformations
Presentation transcript:

Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College PowerPoint Instructor’s Resource

Mathematics for Modeling Some mathematics tools to help you develop your graphics programs

Mathematics is an Important Tool for Computer Graphics In this chapter we survey a number of topics that are each helpful in one or more places in graphics The presentation here may not be as deep as you would like, but you can consult mathematics textbooks for more The order is generally simpler to more complex, but is not systematic

What Is a 2D or 3D Space? We use 2D and 3D Euclidean space Our points are (x,y) or (x,y,z) They correspond to points in 2D or 3D space with X-Y or X-Y-Z coordinates We generally use right-hand coordinates (right) rather than left-hand ones (left)

Points Geometrically, a point is a position in space Algebraically, the point is defined by its coordinates (x,y) or (x,y,z) We will usually see points as vertices in a geometric object However, a triple (x,y,z) or a quadruple (x,y,z,w) will sometimes have another meaning, such as a color

Lines Lines are one-dimensional objects that are associated with a point and a direction vector The line through a given point P 0 in a given direction contains all points P so that the direction from P to P 0 is a scalar multiple of the direction vector If you have two points, the vector from one to the other can be the line’s vector

Lines (2) If you have two points P 0 and P 1, the line containing them can be expressed by for all possible real values of t ; this is called the parameter for the line This equation is about points, but you can easily turn this into equations about each component separately

Rays A ray is defined very much like a line, but only points that lie in the same direction as the line’s vector are included. This is given by the equation of the line except that we only allow values of the parameter t ≥ 0.

Line Segments A line segment is a portion of a line that is given by parameters t in [0,1] With the two-point approach, the line segment contains all the points between P 0 and P 1 When you define two adjacent vertices of a graphics object, the edge between them is a line segment

Line Segments (2) Often the parameter for a line segment will be very important, so we need to understand how parameters match their corresponding points

Parametric Curves A parametric curve is defined by three functions of one parameter x(t), y(t), z(t) For any value of t, the point (x(t), y(t), z(t)) is on the curve We will see a number of parametric curves in our work The parameter is often limited to [0,1]

Parametric Surfaces A parametric surface is defined by three functions of two parameters x(s,t), y(s,t), z(s,t) For any values of the parameters (s, t), the point (x(s,t), y(s,t), z(s,t)) is on the curve We will see even more parametric surfaces in our work The parameters are often limited to [0,1]

Vectors Vectors are much like points and are given by tuples of real numbers Geometrically, vectors represent directions rather than positions Vectors have length, given by A unit vector has length 1

Vector Operations Vectors have four primary operations –Addition (componentwise) –Scalar multiplication –Dot product –Cross product

Dot Product This operation takes two vectors and returns a scalar Operates by adding the componentwise products There are geometric meanings to the dot product

Dot Product (2) Geometrically, the dot product depends on the angle between the vectors –For any two vectors A and B, if theta is the angle between the vectors, –If two vectors have a dot product of zero, they are orthogonal (perpendicular to each other)

Dot Product (3) The dot product is very helpful when you consider the relationship between two vectors The length of the projection of a vector U onto a vector V is given by

Cross Product The cross product of two vectors yields another vector This vector is perpendicular to both of the original vectors The computation is given by a determinant calculation, but more simply:

Cross Product (2) Cross products are not commutative: Cross products are very handy when you want to compute a vector normal to two given vectors (e.g. vertex normals)

Reflection Vectors If you have a normal vector at a point and an incoming vector (e.g. a light vector), you may need to compute the reflection of the incoming vector This is given by

Transformations When we talked about modeling transformations, we focused on what they do rather than on how they are done If we talk about the mathematics, however, we must talk about how they work

Transformations (2) Transformations include scaling, translation, rotation Geometry is processed as 4-tuples (x,y,z,w) and all transformations are linear Thus transformations act as 4x4 matrices

Transformations (3) Scaling matrix Translation matrix

Transformations (4) Rotations are more complex, and we usually think of them only in terms of rotations around coordinate axes For the 2D case: the x -axis rotation R

Transformations (5) Rotations by around each axis: around X around Y around Z The Y case is different because of the axis order

Planes A plane can be defined several ways –A plane is determined by three points –Given a point P and a line L through P, a plane is the set of points X so that the line XP is perpendicular to L These are the same: the three points determine two lines, and the cross product of the lines determines the normal line

Planes (2) Equation of a plane can be derived from the second definition Or, working through this equation and collecting terms, we end up with Here the coefficients A, B, C are the components of the normal vector

Convex Polygons A polygon is complex if for any two points A and B in the polygon, the line between them is all in the polygon Alternately, a convex polygon is the convex sum of its vertices, or for all points P in the polygon, where all values of are in [0,1]

Convex Polygons (2) One convex polygon (left) and two that are not convex (middle and right)

Polar and Cylindrical Coordinates You can identify points in the plane by rectangular coordinates (x,y) or by angle and distance (r,  ) This can be extended to 3D by adding the z coordinate

Spherical Coordinates Use latitude and longitude along with distance Similar to identifying points in space by projecting them from the earth

Triangle-Based Collision Detection With objects built from triangles, to test for collisions you need only test for spherical and triangle collisions