1 / 59

Mathmatics for Computer Graphics

r. A. Mathmatics for Computer Graphics. Contents. Spaces Vectors and Linear combination Affine Combination Coordinate-reference Frames Points and Lines Parametric Representation Linear Transformation Homogeneous Coordinates. Vector Spaces. A nonempty set V of vectors

nita
Télécharger la présentation

Mathmatics for Computer Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. r A Mathmatics for Computer Graphics

  2. Contents • Spaces • Vectors and Linear combination • Affine Combination • Coordinate-reference Frames • Points and Lines • Parametric Representation • Linear Transformation • Homogeneous Coordinates

  3. Vector Spaces • A nonempty set V of vectors • Vectors have magnitude and direction. • Addition + Scalar Multiplication · u+v = v+u V · (u+v)+w = u+(v+w) · u+0 = u · u+(-u) = 0 · cu V ,(c is scalar) · c(u+v) = cu+cv · (c+d)u = cu+du · c(du) = (cd)u · 1u = u Directed Line Segments … but, have no position ! Identical Vectors

  4. Affine Spaces e2  Introducing the concepts of “points”, which represents “the location” e3  Contain the necessary elements for building geometric models e2 e1 e1 e3  Points와 그에 종속된Vector들로 표현 Basis vectors located at the origin P Truncated plane (No Origin) : Vector Space P 기준의 새 좌표계 설정 : Affine Space

  5. Euclidean Spaces • Affine spaces have no concepts of how far apart two points are, or of what the length of a vector is • To Support a measure of distance between points,such as,..Inner Product!

  6. P2 y2 V y1 P1 x1 x2 Points and Vectors • Point : 좌표계의 한 점을 차지 ,위치표시 • Vector : 두 position간의 차로 정의 • Magnitude와 Direction으로도 표기

  7. z  V   y x Vectors (계속) • 3차원에서의 Vector • Vector Addition and Scalar Multiplication

  8. V2  V1 |V2|cos Scalar Product • Dot Product, Inner Product라고도 함 For Cartesian reference frame, Some Properties Commutative Distributive

  9. Scalar Product (계속) (x2,y2) (x1,y1,z1) V2 (x2,y2,z2)  (x1,y1) V1 (x0,y0) (x0,y0,z0) Edge사이의 사잇각 Polygon의 면적

  10. V1 V2 V2  V1 Vector Product • ux,uy,uz를 각 축의 단위 vector라 하면, Properties AntiCommutative Not Assotiative Distributive

  11. Vector Product (계속) Shading, Reflection Model 평면사이의 위치관계

  12. Vector Spaces • A nonempty set V of vectors • Addition + Scalar Multiplication · u+v = v+u V · (u+v)+w = u+(v+w) · u+0 = u · u+(-u) = 0 · cu V ,(c is scalar) · c(u+v) = cu+cv · (c+d)u = cu+du · c(du) = (cd)u · 1u = u

  13. v v Linear Combination • Consist of scalar and vectors Ex) Single Vector의 linear combination v  : real number  : nonnegative

  14. Span • Span Vector set의 모든 가능한 linear combination을 지칭 Ex) Span{v1,v2} v1 +v2 v1 v2 두Vector의 linear combination

  15. Linearly Independence A set of vectors B={v1,…,vp} in V is said to be linearly independent if the vector equation has only the trivial solution c1=0,…,cp=0. (3,1) (6,2) Linearly dependent, w in Span{u,v} v u w Linearly dependent, Collinear (3,2) w (6,2) Linearly independent, wnot in Span{u,v} v u Linearly independent, Not collinear

  16. Basis 어떤 linearly independent vector set B에 의해 vector space H가 span될 때, 이 vector set B를 H의 basis 라 한다. H = Span{b1, … ,bp} z u3 u1 u2 y x The standard basis for R3

  17. for all k for all j k Orthogonal Basis Orthogonal basis - 각 원소 vector들이 서로 직교 할 때 z - u3 u1 u2 y - x Orthonormal basis ※ Orthonormal basis 각 원소 vector들이 서로 직교 하면서 동시에 단위 vector로 이루어져 있을 때

  18. Affine Space • The Extension of the Vector Space • Geometric operation들이 의미를 갖는 공간 • Points와 그에 종속된 vector들로 표현 P Truncated plane (No Origin) : Vector Space P 기준의 새 좌표계 설정 : Affine Space

  19. Affine Combination • Linear combination of points in an affine space make no sense (Operations on the points are limited) • Using Parametric Representation Affine combination of two points Line segment joining P1and P2, if 0 t 1

  20. Affine Combination Generalized form One Example of Affine Combination gives a point in the triangle.

  21. Euclidean Transformation • One-to-One Correspondence between the points of such space and the set of all real-number pair or triples • Transforming Only by rotation and translation Action of the euclidean group on five points

  22. Affine Transformation R is Replaced by a general non-singular transformation matrix A Parallel lines are preseved. Action of the affine group on five points

  23. General Linear Transformation For general non-singular linear transformations T, We get general linear or projective group of transformations. It preserves the collinearity of points. Action of the projective group on five points

  24. Coordinate Reference Frames • Coordinate Reference Frames • Cartesian coordinate system x,y,z좌표축사용, 전형적 좌표계 • Non-Cartesian coordinate system • 특수한 경우의 object표현에 사용. • Polar, Spherical, Cylindrical 좌표계등

  25. 2 D Coordinate System • Two-dimensional Cartesian Reference Frames y x y x a) b)

  26. Polar Coordinates • 가장 많이 쓰이는 non-Cartesian System • Elliptical coordinates, hyperbolic, parabolic plane coordinates등 원 이외에 symmetry를 가진 다른 2차 곡선들로도 좌표계 표현 가능. r 

  27. Why Polar Coordinates? 예) 원의 표현 y y d d x x dx dx 균등하게 분포되지 않은 점들 연속된 점들 사이에 일정간격유지 Polar Coordinates Cartesian Coordinates

  28. 3D Cartesian Frames Three Dimensional Point

  29. 3D Cartesian Frames • 오른손 좌표계 • - 대부분의 Graphics Package에서 표준 • 왼손 좌표계 • - 관찰자로부터 얼마만큼 떨어져 있는지 • 나타내기에 편리함 • - Video Monitor의 좌표계

  30. z axis z z axis P(,,z) P(r,, )  r y axis  y axis   x axis x axis 3D NonCartesian System • Cylindrical coordinates • Spherical coordinates

  31. Points • 가장 기본적인 Output Primitive • 0차원으로 크기와 길이 측정 불가 • 순서쌍(x,y)나 vector형식으로 표기 • Raster Scan display 의 한 Pixel차지 • 2D or 3D

  32. Lines • Defined as a list of points(PolyLine) • Rasterization • Stairstep effect(jaggies)

  33. Line Drawing Algorithm • Accomplished by calculating intermediate positions along the line path between two specified endpoint positions Bresenham’s Line Algorithm

  34. y x Why “y=mx” is not good for Graphics Applications • Defects in Nonparametric representation • Explicit function의 경우 1. Can only represent infinite lines, not finite line segments 2. Cannot represent vertical lines(m=) 3. Can only 2D lines, not 3D • Implicit function의 경우 Redundant representation Ex) 원호의 표현 :

  35. Parametric Line Equation P2 p p = P1 + t * ( P2 - P1 ) P1 x = X1 + t * ( X2 - X1 ) y = Y1 + t * ( Y2 -Y1 ) 0.0  t  1.0 z = Z1 + t * ( Z2 - Z1 )

  36. Parametric Line Equation Can Also be thought of as a blending function... P2 P1 x = ( 1 - t ) * X1 + t * X2 y = ( 1 - t ) * Y1 + t * Y2 0.0  t  1.0 z = ( 1 - t ) * Z1 + t * Z2

  37. Linear Blending You can linearly blend any two quantities with : q = Q1 + t * ( Q2 - Q1 ) Or, if you’d prefer : q = ( 1 - t ) * Q1 + t * Q2 Color, Shape, Location, Angle, Scale factors,….

  38. Matrices • Definition • A rectangular array of quantities • Scalar multiplication and Matrix Addition

  39. j-th column i-th row m × = (i,j) l l n m n Matrix Multiplication • Definition • Properties Not Commutative Assotiative Distributive Scalar multiplication

  40. Translation y P x (a) y P’ x (b)

  41. (xf,yf) y P1 P2 P3 x (xf, yf) : fixed point Scaling x’ = x · Sx , y’ = y · Sy x x’ x’ = xf + (x-xf) sx , y’ = yf + ( y- yf) sy

  42. Rotation P’ = R P x = r cos  , y = r sin  x’ = r cos ( + ) = r cos  cos  - r sin  sin  y’ = r sin ( + ) = r cos  sin  + r sin  cos   x’= x cos  - y sin , y’ = x sin  + y cos  (x’,y’) r  (x,y) r  죄표중심을 회전점으로 각  만큼 회전

  43. Homogeneous Coordinates In basic Transformations, ( Addition ) Only Translation is treated differently ( Multiplication ) ( Multiplication ) We hope to combine the multiplicative and translational terms for two-dimensional geometric transformations into a single matrix representation for enabling the composite transformations such as,

  44. (xf,yf) y P1 P2 P3 x (xf, yf) : fixed point Extend the matrix We can solve this problem by extending 2 by2 matrix into 3 by 3 matrix Rotation Scaling Translation Ex)

  45. y P(hx1,hy1,h) = P(X,Y, h) z =3 P(3x1,3y1,3) z =2 z =1 P(2x1,2y1,2) x P(x1,y1,1) Homogeneous Space Any two dimensional point can be represented by one of the points along the ray in 3D space 3D Representarion of homogeneous space

  46. Point at Infinity The points with h=0 are called points at infinity, and this will not appear very often. Ex) [ X Y h ] = [ 4 3 1]

  47. Point at Infinity(Cont’d) Ex) The intersection point of two Parallel lines The resulting homogeneous coordinates [1 -1 0] represent the ‘point of intersection’ for the two parallel lines, i.e. a point at infinity.

  48. Point at Infinity(Cont’d) B A Two Lines are intersect each other if they are not parallel Non-Homogeneous treatment !!

  49. Determinant of Matrix • For n 2, the Determinant of nn matrix A is, and for a 2 by 2 matrix, Ex) • if A is a triangular matrix, det A is the product of the entries on the main diagonal of A

  50. Properties of Determinants • Row Operations Let A,B be a square matrix 1) A의 한 행의 실수배가 다른 row에 더해져 B를 만들었다면, detB = detA 2) A의 두 행이 교환되어 B를 생성했다면, detB = -detA 3) A의 한 행이 k배된 것이 B라면, detB = kdetA Ex) • Column Operations

More Related