Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mathematics for Computer Graphics

Similar presentations


Presentation on theme: "Mathematics for Computer Graphics"— Presentation transcript:

1 Mathematics for Computer Graphics
Graphics Laboratory Korea University

2 Contents Coordinate Systems Points and Vectors Matrices
Parametric vs. Nonparametric Representations

3 Coordinate Systems Rectangular (Cartesian) Polar Cylindrical Spherical
x, y, z axes Typical coordinate system Right/left-hand system Polar Cylindrical Spherical

4 2D Rectangular Coordinate System
x y x Coordinate origin at the lower-left screen corner Coordinate origin at the upper-left screen corner <Window Coordinate System> <Screen Coordinate System>

5 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 Polar Coordinate System
p(r,) r s x

7 Why Polar Coordinates in Circles?
In rectangular system Irregular distribution of continuous points y y d d x x dx dx Constant Distance among the Adjacent Points Irregularly Distributed Adjacent Points Rectangular Coordinate System Polar Coordinate System

8 Cylindrical / Spherical System
x z r p(r,, ) z y x r p(r,,z) Cylindrical Coordinate System Spherical Coordinate System

9 Points and Vectors Point: location, position
Vector: direction from one point to another Represented by using magnitude and unit direction y P2 y2 V y1 P1 x x1 x2

10 Vectors 3D Vector Vector addition and scalar multiplication z V   y
V x z y 3D Vector Vector addition and scalar multiplication

11 Dot Product / Inner Product
Scalar Product Definition Properties Commutative Distributive |V2|cos V2 V1 Dot Product / Inner Product

12 Careful for its direction!!!
Vector Product Definition Properties Anti-commutative Not associative Distributive V1 V2 V1  V2 u Cross Product / Outer Product Careful for its direction!!!

13 Plane Normal Calculation
Frequently used in Back face detection Shading function Vector product between Two edges of the target polygon N = V1 × V2 P4 V2 P3 P0 V1 P2 P1

14 Back Face Detection Not drawing the back faces to be culled
Can make the drawing speed faster Scalar product between Eye direction Deye and face normal vector Ni If DeyeNi > 0 Fi is back face

15 Back Face Example Eye N4 N3 F4 F3 N2 N5 F2 F5 Eye Direction Deye(1,0)
(-0.9, -0.1) N2 (-0.8, 0.2) N3 (-0.2, 0.8) N4 (0.3, 0.7) N5 (0.8, 0.2) F1 F2 F3 F4 F5

16 Back Face Calculation F1 F2 F3 F4 F5
DeyeN1 = (1,0)(-0.9, -0.1) =  F1 is a front face F2 DeyeN2 = (1,0)(-0.8, 0.2) =  F2 is a front face F3 DeyeN3 = (1,0)(-0.2, 0.8) =  F3 is a front face F4 DeyeN4 = (1,0)(0.3, 0.7) =  F4 is a back face F5 DeyeN5 = (1,0)(0.8, 0.2) =  F5 is a back face

17 Back Face Culled Result
N4 (0.3, 0.7) N3 (-0.2, 0.8) F4 F3 N2 (-0.8, 0.2) N5 (0.8, 0.2) F2 Eye Direction Deye(1,0) F5 Eye F1 N1 (-0.9, -0.1)

18 <Simple Shading Function>
The amount of illumination depends on cos If the incoming light Iin is perpendicular to the surface Isurf is maximum, so the surface is fully illuminated  = 0, cos = 1 N L Isurf: intensity of the surface Iin: intensity of the incident light k: surface reflection coefficient L: direction from the surface to a light source <Simple Shading Function>

19 Matrices Definition Scalar multiplication and matrix addition
A rectangular array of quantities Scalar multiplication and matrix addition

20 Matrix Multiplication
Definition Properties Not commutative Associative Distributive Scalar multiplication j-th column i-th row × m = l l (i,j) m n n

21 Matrix Transpose Definition Transpose of matrix product
Interchanging rows and columns Transpose of matrix product

22 Determinant of Matrix Definition 2  2 matrix
For a square matrix Combining the matrix elements to product a single number 2  2 matrix Determinant of nn matrix A (n 2) Determinant of N x N Matrix

23 Inverse Matrix Definition 2  2 matrix Properties Non-singular matrix
If and only if the determinant of the matrix is non-zero 2  2 matrix Properties

24 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: y y Which one is balanced? -2 2 x -2 -1 1 2 x Parametric Expression Interval of : /4 Nonparametric Expression Interval of x: 1

25 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 "Mathematics for Computer Graphics"

Similar presentations


Ads by Google