Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graphics Graphics Korea University Mathematics for Computer Graphics Graphics Laboratory Korea University.

Similar presentations


Presentation on theme: "Graphics Graphics Korea University Mathematics for Computer Graphics Graphics Laboratory Korea University."— Presentation transcript:

1 Graphics Graphics Lab @ Korea University http://kucg.korea.ac.kr Mathematics for Computer Graphics Graphics Laboratory Korea University

2 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Contents Coordinate Systems Points and Vectors Matrices Parametric vs. Nonparametric Representations

3 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Coordinate Systems Rectangular x, y, z axes Typical coordinate system Right/left-hand system Polar Cylindrical Spherical

4 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr 2D Rectangular Coordinate System Coordinate origin at the lower-left screen corner y x y x Coordinate origin at the upper-left screen corner

5 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr 3D Rectangular Coordinate System Right-hand system Standard in most graphics packages Left-hand system Easy to know the distance from the viewer Video monitor coordinate system

6 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Polar Coordinate System  r s x y p(r,  )

7 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Why Polar Coordinates in Circles? x y dddd dddd Irregularly Distributed Adjacent Points Constant Distance among the Adjacent Points Polar Coordinate System Rectangular Coordinate System In rectangular system Irregular distribution of continuous points x y dxdx

8 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Cylindrical / Spherical Systemzy x r z  p(r, ,z) y xz  r p(r, ,  ) Spherical Coordinate System Cylindrical Coordinate System

9 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Point: location, position Vector: direction from one point to another Represented by using magnitude and unit direction V P2P2P2P2 P1P1P1P1 x1x1x1x1 x2x2x2x2 y1y1y1y1 y2y2y2y2 Points and Vectors  x y

10 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Vectors 3D Vector Vector addition and scalar multiplication    V xzy

11 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Scalar Product Definition Properties Commutative Distributive Dot Product / Inner Product |V 2 |cos   V2V2V2V2 V1V1V1V1

12 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Vector Product Definition Properties Anti-commutative Not associative Distributive Cross Product / Outer Product V1V1V1V1 V2V2V2V2 V1  V2V1  V2V1  V2V1  V2 u Careful for its direction!!!

13 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Plane Normal Calculation Frequently used in Back face detection Shading function Vector product Vector product between Two edges of the target polygon V1V1V1V1 V2V2V2V2 N = V 1 × V 2 P0P0P0P0 P1P1P1P1 P2P2P2P2 P3P3P3P3 P4P4P4P4

14 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Back Face Detection Not drawing the back faces to be culled Can make the drawing speed faster Scalar product Scalar product between D eye N i  Eye direction D eye and face normal vector N i D eye  N i If D eye  N i > 0  F i  F i is back face

15 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Back Face Example Eye Eye Direction D eye (1,0) N 1 (-0.9, -0.1) N 2 (-0.8, 0.2) N 3 (-0.2, 0.8) N 4 (0.3, 0.7) N 5 (0.8, 0.2) F1F1F1F1 F2F2F2F2 F3F3F3F3 F4F4F4F4 F5F5F5F5

16 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Back Face Calculation F 1 D eye  N 1 = (1,0)  (-0.9, -0.1) = -0.9  F 1 is a front face F 2 D eye  N 2 = (1,0)  (-0.8, 0.2) = -0.8  F 2 is a front face F 3 D eye  N 3 = (1,0)  (-0.2, 0.8) = -0.2  F 3 is a front face F 4 D eye  N 4 = (1,0)  (0.3, 0.7) = 0.3  F 4 is a back face F 5 D eye  N 5 = (1,0)  (0.8, 0.2) = 0.8  F 5 is a back face

17 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Back Face Culled Result Eye Eye Direction D eye (1,0) N 1 (-0.9, -0.1) N 2 (-0.8, 0.2) N 3 (-0.2, 0.8) N 4 (0.3, 0.7) N 5 (0.8, 0.2) F1F1F1F1 F2F2F2F2 F3F3F3F3 F4F4F4F4 F5F5F5F5

18 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Shading Function cos  The amount of illumination depends on cos  I in If the incoming light I in is perpendicular to the surface  I surf  I surf is maximum, so the surface is fully illuminated   cos    = 0, cos  = 1  NL I surf : intensity of the surface I in : intensity of the incident light k : surface reflection coefficient L : direction from the surface to a light source

19 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Matrices Definition A rectangular array of quantities Scalar multiplication and matrix addition

20 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Matrix Multiplication Definition Properties Not commutative Associative Distributive Scalar multiplication ×= (i,j) j-th column i-th row m l n n m l

21 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Matrix Transpose Definition Interchanging rows and columns Transpose of matrix product

22 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Determinant of Matrix Definition For a square matrix  Combining the matrix elements to product a single number 2  2 matrix Determinant of n  n matrix A (n  2)

23 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Inverse Matrix Definition Non-singular matrix  If and only if the determinant of the matrix is non-zero 2  2 matrix Properties

24 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Parametric vs. Nonparametric Representations Circle example in computer graphics  radius 2, centered at the origin Parametric expression: x = 2cos , y = 2sin  Nonparametric expression  Implicit:, explicit: x y x y 0 12-2 Parametric Expression Interval of  :  /4 Nonparametric Expression Interval of x: 1 Which one is balanced? 2-2

25 KUCG Graphics Lab @ Korea University http://kucg.korea.ac.kr Parametric Representation Easy to draw the shape of an object smoothly Just increase one parameter ex)   The other parameters are automatically calculated by  Especially for symmetric objects  Circle, sphere, ellipsoid, etc. Preferred in computer graphics Nonparametric representation is used mainly in numerical analysis


Download ppt "Graphics Graphics Korea University Mathematics for Computer Graphics Graphics Laboratory Korea University."

Similar presentations


Ads by Google