3D Geometry for Computer Graphics

Slides:



Advertisements
Similar presentations
Computer Graphics - Geometry & Representation -
Advertisements

Vectors Part Trois.
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.
Geometry Primer Lines and rays Planes Spheres Frustums Triangles Polygon Polyhedron.
UBI 516 Advanced Computer Graphics

Even More Vectors.
GEOMETRY Chapter 3: Angle Pairs, Lines and Planes
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Object Representation 고려대학교 컴퓨터 그래픽스 연구실.
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:
Basic Math Vectors and Scalars Addition/Subtraction of Vectors Unit Vectors Dot Product.
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
Chapter 2: Vectors Ian Parberry University of North Texas Fletcher Dunn Valve Software 3D Math Primer for Graphics and Game Development.
Lecture 2: Geometry vs Linear Algebra Points-Vectors and Distance-Norm Shang-Hua Teng.
Vectors.
VECTORS AND THE GEOMETRY OF SPACE 12. VECTORS AND THE GEOMETRY OF SPACE A line in the xy-plane is determined when a point on the line and the direction.
Vectors: planes. The plane Normal equation of the plane.
2IV60 Computer Graphics Basic Math for CG
ME751 Advanced Computational Multibody Dynamics Review Calculus Starting Chapter 9 of Haug book January 26, 2010 © Dan Negrut, 2010 ME751, UW-Madison "Motivation.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
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.
1 1.9 © 2016 Pearson Education, Inc. Linear Equations in Linear Algebra THE MATRIX OF A LINEAR TRANSFORMATION.
COMP 175: Computer Graphics March 24, 2015
7.1 Scalars and vectors Scalar: a quantity specified by its magnitude, for example: temperature, time, mass, and density Chapter 7 Vector algebra Vector:
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.
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.
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
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.
1.3 Lines and Planes. To determine a line L, we need a point P(x 1,y 1,z 1 ) on L and a direction vector for the line L. The parametric equations of a.
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.
Vector Tools for Computer Graphics
CS 551 / 645: Introductory Computer Graphics Mathematical Foundations.
Basic Entities Scalars - real numbers sizes/lengths/angles Vectors - typically 2D, 3D, 4D directions Points - typically 2D, 3D, 4D locations Basic Geometry.
DOT PRODUCT CROSS PRODUCT APPLICATIONS
1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.
Computational Geometry 2012/10/23. Computational Geometry A branch of computer science that studies algorithms for solving geometric problems Applications:
Advanced Computer Graphics CS32310 October 2012 H Holstein.
Vectors and the Geometry of Space Section 10.4 Lines and Planes in Space 2015.
2/28/2016 CS 551 / 645: Introductory Computer Graphics Framebuffer Mathematical Foundations The Rendering Pipeline.
 Solve each equation: . Warm up. Lesson 10-1 Introduction to Analytical Geometry Objective: To find the distance and midpoint between two points on.
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.
David Luebke6/12/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Chapter I Vectors and Scalars AAIT Engineering Mechanics Statics Department of Tewodros N. Civil Engineering.
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.
Unit-4 Geometric Objects and Transformations- I
CA 302 Computer Graphics and Visual Programming
Prof. Dr. Faisel Ghazi Mohammed
Lesson 3-6: Perpendicular & Distance
VECTORS APPLICATIONS NHAA/IMK/UNIMAP.
Intersection between - Lines, - Planes and - a plane & a Line
CSC461: Lecture 12 Geometry Objectives
By the end of Week 3: You would learn how to solve many problems involving lines/planes and manipulate with different coordinate systems. These are.
Introduction to Computer Graphics with WebGL
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
Lecture 2: Geometry vs Linear Algebra Points-Vectors and Distance-Norm
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Presentation transcript:

3D Geometry for Computer Graphics Class 1

General Office hour: Tuesday 11:00 – 12:00 in Schreiber 002 (contact in advance) Webpage with the slides, homework: http://www.cs.tau.ac.il/~sorkine/courses/cg/cg2006/ E-mail: sorkine@tau.ac.il

The plan today Basic linear algebra and Analytical geometry

Why??

Manipulation of geometry and color… Monsters, Inc

Manipulation of geometry and color…

Manipulation of geometry and color…

Manipulation of geometry and color…

Manipulation of geometry and color…

Why?? We represent objects using mainly linear primitives: points lines, segments planes, polygons Need to know how to compute distances, transformations, projections…

How to approach geometric problems We have two ways: Employ our geometric intuition Formalize everything and employ our algebra skills Often we first do No.1 and then solve with No.2 For complex problems No.1 is not always easy…

Example: distance between 2 lines in 3D Geometric problem: we have two lines (or segments) in 3D, need to find the distance between them

Example: distance between 2 lines in 3D Geometric approach: If we look from the direction of one of the lines, that line reduces to a point So all we need is point-line distance in 2D (the projection plane) By projecting, we reduced the problem from 3D to 2D

Example: distance between 2 lines in 3D Geometric approach: We can continue reducing the dimension! Project the red point and the blue line on the plane perpendicular to the blue line Now we get point-point distance

Example: distance between 2 lines in 3D But how do we get the actual number? Need to represent the lines mathematically OK… Write down the projection formulae Have to wipe the dust off our algebra… Compute the point-point distance Easy

Example: distance between 2 lines in 3D Alternative: (Almost) skip the geometric intuition step… Represent the lines mathematically We know that the distance is achieved at a segment that is perpendicular to both lines Write down the equation for that segment and solve

Conclusion so far: review our algebra… With or without geometric intuition and good 3D orientation, in any case we need to review our algebra…

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

Point + vector = point

vector + vector = vector Parallelogram rule

point - point = vector B – A B A A – B B A

point + point: not defined!!

Map points to vectors If we have a coordinate system with origin at point O We can define correspondence between points and vectors: p O

Inner (dot) product Defined for vectors: w  v L Projection of w onto v

Dot product in coordinates (2D) y yw w yv v xw xv O x

Perpendicular vectors In 2D only: v v

Distance between two points y A yA B yB xA xB O x

Parametric equation of a line v t > 0 p0 t = 0 t < 0

Parametric equation of a ray v t > 0 p0 t = 0

Distance between point and line v q q’ = p0 +tv Find a point q’ such that (q  q’)v dist(q, l) = || q  q’ || l

Easy geometric interpretation q l v q’ p0 L

Distance between point and line – also works in 3D! The parametric representation of the line is coordinates-independent v and p0 and the checked point q can be in 2D or in 3D or in any dimension…

Implicit equation of a line in 2D y Ax+By+C > 0 Ax+By+C = 0 Ax+By+C < 0 x

Line-segment intersection Q1 (x1, y1) y Ax+By+C > 0 Q2 (x2, y2) Ax+By+C < 0 x

Representation of a plane in 3D space A plane  is defined by a normal n and one point in the plane p0. A point q belongs to the plane  < q – p0 , n > = 0 The normal n is perpendicular to all vectors in the plane n q p0 

Distance between point and plane Project the point onto the plane in the direction of the normal: dist(q, ) = ||q’ – q|| n q q’ p0 

Distance between point and plane q q’ p0 

Distance between point and plane Geometric way: Project (q - p0) onto n! n q p0 

Implicit representation of planes in 3D (x, y, z) are coordinates of a point on the plane (A, B, C) are the coordinates of a normal vector to the plane Ax+By+Cz+D > 0 Ax+By+Cz+D = 0 Ax+By+Cz+D < 0

Distance between two lines in 3D q1 p1 u d p2 v l2 q2 The distance is attained between two points q1 and q2 so that (q1 – q2)  u and (q1 – q2)  v

Distance between two lines in 3D q1 p1 u d p2 v l2 q2

Distance between two lines in 3D q1 p1 u d p2 v l2 q2

Distance between two lines in 3D q1 p1 u d p2 v l2 q2

Distance between two lines in 3D Exercise (תרגיל רשות): Develop the distance formula using the geometric intuition we talked about in the beginning of the class Compare to the formula we’ve just developed analytically

See you next time!

Barycentric coordinates (2D) Define a point’s position relatively to some fixed points. P = A + B + C, where A, B, C are not on one line, and , ,   R. (, , ) are called Barycentric coordinates of P with respect to A, B, C (unique!) If P is inside the triangle, then ++=1, , ,  > 0 C P A B

Barycentric coordinates (2D) P A B

Example of usage: warping

Example of usage: warping C Tagret B A We take the barycentric coordinates , ,  of P’ with respect to A’, B’, C’. Color(P) = Color( A +  B +  C)